-
Notifications
You must be signed in to change notification settings - Fork 44
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
Enable colour in console output #896
Enable colour in console output #896
Conversation
To parse cargo logs.
It was disabled becuase parsing lgos to extract the services URLs was not working due to hidden color chars. This changes the parser to ignore color chars.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #896 +/- ##
===========================================
+ Coverage 78.50% 78.53% +0.03%
===========================================
Files 171 171
Lines 9443 9458 +15
===========================================
+ Hits 7413 7428 +15
Misses 2030 2030 ☔ View full report in Codecov by Sentry. |
Regarding using tracing capabilities, for example, the folowwing Rust logging line: info!(target: "UDP TRACKER", "Started on: udp://{}", address); Produces this output: 2024-06-14T16:20:54.690047Z INFO UDP TRACKER: Started on: udp://0.0.0.0:6969 But we could use instead: event!(target: "UDP TRACKER", Level::INFO, started_on_socket_address = format!("udp://{}", address.to_string())); Which produces: 2024-06-14T16:20:54.690052Z INFO UDP TRACKER: started_on_socket_address="udp://0.0.0.0:6969" I guess the second one is easier to parse: And it scales much better, we can add more fields. We have to research how this fits with new login styles like JSON format. cc @da2ce7 |
ACK eb928bc |
Enable colour in console output.
We were using the
logging
crate for logging. We move totracing
but keeping the same format for logs. The only difference was the colour introduced by thetracing
crate. This is just a patch to allow using color with tracing. We parse the logs to extract the running services for example from these lines:We extract these running services:
We should refactor the output format to take advantage of the new
tracing
crate.tracing
supports structured fields on spans and events, so it would be easier to parse those services.