Add logging in project based on 'log' library.#12
Conversation
Add stdout logs in tests. Example stdout logging during tests: [2023-08-12T08:45:02Z WARN hf_hub] File with your token is absent by path "C:\\Users\\igumn\\.cache\\huggingface\\token"
Narsil
left a comment
There was a problem hiding this comment.
Thanks for the contribution.
Happy to improve a bit the logging, but left a few remarks regarding style.
Happy to make the modifications myself.
|
Can we use tracing instead of env_logger ? |
Yes, there are list of loggers: simple_logger You could visit page https://crates.io/crates/log and find all list of loggers |
|
I was talking about the https://lib.rs/crates/tracing crate specifically :) |
If you ask my opinion. I think, yes it is possible to use tracing libray for logging like log library.
|
Narsil
left a comment
There was a problem hiding this comment.
LGTM ! Thanks for the modifications.
|
I'll go ahead and merge for now, we can revisit later. IMO this crate should be minimalistic, hence logging (and sparingly) should be OK. |
|
For the record, I'm not happy about this 😄
|
|
https://crates.io/crates/tracing (~200k/day) I don't care that much about it either way, ideally I think we just should just have neither, or behind feature flags. |
|
Ah I didn't think log was as ubiquitous, looks like a sync vs async divide, tokio has a dependency on I also thought log had less features for libraries, but either I missed it at the time, either it caught up. |
|
You live in |
Add stdout logs in tests.
Example stdout logging during tests:
[2023-08-12T08:45:02Z WARN hf_hub] File with your token is absent by path "C:\Users\igumn\.cache\huggingface\token"