f321x / cashu-escrow-kit

Ecash escrow provider and client concept. Ecash hackathon project with @rodant.
MIT License
14 stars 3 forks source link

Logging and debugging concept needed #13

Closed rodant closed 2 months ago

rodant commented 2 months ago

We need a general concept for debugging or logging at different levels: error, warning, info, etc. Let's find a good solution for that and implement it across the project.

f321x commented 2 months ago

I previously used the env_logger crate for this use case. It can be initialized like this:

fn main() -> Result<()> {
    env_logger::builder()
        .filter_module("coordinator", log::LevelFilter::Debug) // level for the application itself
        .filter_level(log::LevelFilter::Info)  // level for imported crates
        .init();

then we have the following macros available for logging:

error!()
warn!()
info!()
debug!()
trace!()
f321x commented 2 months ago

Fixed with https://github.com/f321x/cashu-escrow-kit/pull/19