-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #896: Enable colour in console output
eb928bc fix: [#893] enable color for logs (Jose Celano) a293373 chore(deps): add cargo dependency regex (Jose Celano) a88082a fix: [#893] enable color in logs (Jose Celano) Pull request description: Enable colour in console output. We were using the `logging` crate for logging. [We move to `tracing`](#884) but keeping the same format for logs. The only difference was the colour introduced by the `tracing` crate. This is just a patch to make allow using color with tracing. We parse the logs to extract the running services for example from these lines: ``` 2024-06-10T16:07:39.989540Z INFO torrust_tracker::bootstrap::logging: logging initialized. 2024-06-10T16:07:39.990205Z INFO UDP TRACKER: Starting on: udp://0.0.0.0:6868 2024-06-10T16:07:39.990215Z INFO UDP TRACKER: Started on: udp://0.0.0.0:6868 2024-06-10T16:07:39.990244Z INFO UDP TRACKER: Starting on: udp://0.0.0.0:6969 2024-06-10T16:07:39.990255Z INFO UDP TRACKER: Started on: udp://0.0.0.0:6969 2024-06-10T16:07:39.990261Z INFO torrust_tracker::bootstrap::jobs: TLS not enabled 2024-06-10T16:07:39.990303Z INFO HTTP TRACKER: Starting on: http://0.0.0.0:7070 2024-06-10T16:07:39.990439Z INFO HTTP TRACKER: Started on: http://0.0.0.0:7070 2024-06-10T16:07:39.990448Z INFO torrust_tracker::bootstrap::jobs: TLS not enabled 2024-06-10T16:07:39.990563Z INFO API: Starting on http://127.0.0.1:1212 2024-06-10T16:07:39.990565Z INFO API: Started on http://127.0.0.1:1212 2024-06-10T16:07:39.990577Z INFO HEALTH CHECK API: Starting on: http://127.0.0.1:1313 2024-06-10T16:07:39.990638Z INFO HEALTH CHECK API: Started on: http://127.0.0.1:1313 ``` We extract these running services: ```json { "udp_trackers": [ "127.0.0.1:6969" ], "http_trackers": [ "http://127.0.0.1:7070" ], "health_checks": [ "http://127.0.0.1:1313/health_check" ] } ``` We should refactor the output format to take advantage of the new `tracing` crate. [`tracing` supports structured fields on spans and events](https://docs.rs/tracing/latest/tracing/#recording-fields), so it would be easier to parse those services. ACKs for top commit: josecelano: ACK eb928bc Tree-SHA512: 890b80df3688f8aedf6587a59cacc638df5f40c025ad0d361096362578844893b29a8d8963ccf28ab100d8296ea280fd0fcd876ef317c1363c6daaad4549954e
- Loading branch information
Showing
7 changed files
with
50 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters