add log to hedu

This commit is contained in:
Christoph J. Scherr 2024-01-16 14:04:06 +01:00
parent 0515e221f9
commit 39a21d64e9
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
2 changed files with 3 additions and 0 deletions

View File

@ -17,3 +17,4 @@ categories.workspace = true
[dependencies] [dependencies]
anyhow = { workspace = true } anyhow = { workspace = true }
thiserror = { workspace = true } thiserror = { workspace = true }
libpt-log = {path = "../libpt-log" }

View File

@ -7,6 +7,7 @@
use anyhow::{bail, Result}; use anyhow::{bail, Result};
use std::io::{prelude::*, BufReader}; use std::io::{prelude::*, BufReader};
use libpt_log::error;
const BYTES_PER_LINE: usize = 16; const BYTES_PER_LINE: usize = 16;
const LINE_SEP_HORIZ: char = '─'; const LINE_SEP_HORIZ: char = '─';
@ -80,6 +81,7 @@ where
match data.read(&mut buf) { match data.read(&mut buf) {
Ok(len) => Ok(len), Ok(len) => Ok(len),
Err(err) => { Err(err) => {
error!("error while reading data: {err}");
bail!(err) bail!(err)
} }
} }