Giter Site home page Giter Site logo

Comments (6)

ShayBox avatar ShayBox commented on June 4, 2024

Unrelated, but you should use the log or tracing crates to print info/warn/error messages instead of prepending [WARN] so the final binary programs can subscribe/filter/modify the logs of libraries.

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024

Thanks for letting me know! I agree that we need better logging. I will add the pretty_env_logger or just the log crate and more log entries because it's a good way to catch errors.

Regarding error types, I'm not sure if we should have strict error types or not, but we definitely need to change the type I used

from rookie.

ShayBox avatar ShayBox commented on June 4, 2024

I'm not too familiar with the log/env_logger/pretty_env_logger family of crates, as I use tracing/tracing_subscriber crates.

I assume env_logger/pretty_env_logger (tracing_subscriber) is meant to be used in the binary to configure logging, while log (tracing) is meant to be used in both to do the logging.

I usually use anyhow for everything, unless I think there's a need for multiple error types.

If there's a method that can error for multiple reasons and if there's a good chance the end user might need to know the difference for behavior or if they just need to know Ok/Err

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024

Hi
I changed all the errors to throw Result of anyhow, and also added logging using log.
Can you try it before I publish?

You can add it to Cargo.toml and add the latest code this way:

[dependencies]
rookie = { git = "https://github.com/thewh1teagle/rookie" }

from rookie.

ShayBox avatar ShayBox commented on June 4, 2024

It works!

from rookie.

thewh1teagle avatar thewh1teagle commented on June 4, 2024

Great!
added to latest version.

from rookie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.