refactor: refactor to `spdlog-rs` instead of `tracing`
Refactor tracing to spdlog-rs for logging.
This closes #486 .
cc @SpriteOvO
Initially it looks good, but what I'm wondering is whether we should just replace the tracing family directly with spdlog instead of optional?
Yeah we should replace tracing with spdlog, current codes is just convenient for debugging. I'll delete the tracing codes after spdlog parts are good to go.
FYI, SpriteOvO/spdlog-rs#93 is merged.
I'll work on this PR tomorrow.
spdlog-rs is set to main-dev branch now.
FYI, we have just released spdlog-rs v0.5.0. You could target the dependency spdlog-rs in this PR to the crates.io registry now.
Updated to v0.5.0
Doc tests should be fixed now
Ok I think clippy check is passed now...
Basically LGTM, @eatradish is there anything you are still concerned about?
LGTM, I'll test the functionality tomorrow
80col limit feature is broken
I'm so sorry for AFK for 3 weeks, I'm busy at study recently so I don't have much time for this, really sorry for this :(
I'm continue this PR now.
After reviewing the code I think that if we can migrate console.rs/src/writer.rs to spdlog-rs? Since the Writer directly use console crate to print the log.
We can migrate all the Writer functions and behavior to OmaFormatter and remove Writer.
Will it be a good idea? 🤔
@NotEvenANeko
We can migrate all the
Writerfunctions and behavior toOmaFormatterand removeWriter.Will it be a good idea? 🤔
I think putting the behavior "writing to console" into a formatter is not an ideal design. Why don't we just replace the field term: Term in Writer with buf: String, then return it from the formatter?
Not the print to console behavior, I mean that we can move the formatting part into OmaFormatter, and the printing part is obviously moved to StdStreamSink. However we may need information against terminal, I think we can make an OmaStdoutFormatter to handle terminal-related formatting instead of leaving these parts mixed together in Writer.
Not the
print to consolebehavior, I mean that we can move the formatting part intoOmaFormatter, and the printing part is obviously moved toStdStreamSink. However we may need information against terminal, I think we can make anOmaStdoutFormatterto handle terminal-related formatting instead of leaving these parts mixed together inWriter.
I think it's acceptable.