Use tracing subscriber to log the log messages#287
Conversation
|
I'd like to not wait to long with this as I don't want to keep syncing it. |
|
Just my 10c but if you're touching all the log statements anyway I'd import |
|
I suppose you're right, this was just easier. I'll see what I can do. |
| } | ||
| pub fn launch(config: &LoggingConfig) -> Result<&'static Logger, String> { | ||
| let mut filter = EnvFilter::from_env("CASCADE_LOG"); | ||
| filter = filter.add_directive(LevelFilter::from(*config.level.value()).into()); |
There was a problem hiding this comment.
If CASCADE_LOG specifies a log level of WARN and config sets INFO. Does WARN get logged or is it overridden by INFO from config?
There was a problem hiding this comment.
I removed CASCADE_LOG from here. However, your question still applies to the CASCADE_LOG_LEVEL and I'm getting lost in that code. It's doing what it was before.
|
So do I understand correctly that "pretty colours" are only when logging to stdxxx? I don't see the colour codes in the output e.g. when logging to a file and also need to disable daemonizing to see the whole log output on stdxxx. |
Yes, this was on purpose. Happy to change it. Even for files you can force it with |
bal-e
left a comment
There was a problem hiding this comment.
Blocker: tracing-rfc-5424 is licensed GPL-3.0-or-later. We cannot use it from Cascade.
Unrelated: Do we want to apply a ban on using log::*, like we did for println! / eprintln! for the CLI?
38a1941 to
cdb16ca
Compare
cdb16ca to
f8d4c8e
Compare
Files should not contain ansi color codes. If a user wants them, they should use FORCE_COLOR=1 |
bal-e
left a comment
There was a problem hiding this comment.
The new syslog code looks great, well done! Some of my comments from my previous review are still relevant, but the main blocker for this PR is gone. I'd still like those answered before we move forward.
I did realize that this is currently not possible currently. Do we need that @mozzieongit? |
No |
🌈 Pretty colors 🌈
A next step would be to
completely remove thestart usinglogcrate andtracingspans to give the logging more info, so we can start doing more filtering (e.g. filter on the zone).~I apologize for the branch name.