-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved logging #123
base: main
Are you sure you want to change the base?
Improved logging #123
Conversation
@@ -742,10 +873,6 @@ fn run_compose( | |||
Ok(()) | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tssk, someone is removing all by formatting whitespace :P
I'm trying to check out how it looks like, but it seems like the output of BRANE_API_LOG=DEBUG ./target/release/branectl start central or, to try and trigger your tracing error: BRANE_LOG=DaskjdhasdEBUG ./target/release/branectl start central but none of them seem to have any effect on Maybe there's something weird with caching here? |
4415bae
to
c87372b
Compare
I forgot to remove an optimization that it would not generate an overlay if there were no hostname overrides. This did not fail for me before as I used to always set It should "work" now. Don't expect too much however, it is still very drafty. |
This uses the `tracing_subscriber` with `EnvFilter` to get log levels that can be set using environment variables. This also enables `branectl` to translate a set of environment variables so that every container can get a specific log level set at start
This guard clause was a correct optimization before we set loglevels via overrides
caf5d87
to
00003e7
Compare
|
||
match std::env::var(&log_var) { | ||
Ok(val) => return Some(val), | ||
// TODO: Could use the trace! macro from error-trace. |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
|
||
match std::env::var("BRANE_LOG") { | ||
Ok(val) => return Some(val), | ||
// TODO: Could use the trace! macro from error-trace. |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
This uses the
tracing_subscriber
withEnvFilter
to get log levels that can be set using environment variables.This also enables
branectl
to translate a set of environment variables so that every container can get a specific log level set at startThis currently only changes the logging for the brane-api crate as an indication what this would look like.
I am not entirely happy with my solution for the env var translation in branectl, but it is good enough for a draft right now.
@Lut99, what do you think?
Marking this PR as a draft until we hash out how we want to do this, and until all workspace members have been converted.
Fixes: #116