Skip to content
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

Move from log to tracing crate #623

Merged

Conversation

josecelano
Copy link
Member

Move from log to tracing crate.

Old output:

$ cargo run
   Compiling torrust-index v3.0.0-alpha.3-develop (/home/josecelano/Documents/github/committer/me/torrust/torrust-index)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.31s
     Running `target/debug/torrust-index`
Loading configuration from default configuration file: `./share/default/config/index.development.sqlite3.toml` ...
2024-06-07T15:35:08.192302724+01:00 [torrust_index::bootstrap::logging][INFO] logging initialized.
2024-06-07T15:35:08.252784599+01:00 [torrust_index::web::api::server][INFO] TLS not enabled
2024-06-07T15:35:08.252892290+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer launcher started
2024-06-07T15:35:08.252979221+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer cronjob starting ...
2024-06-07T15:35:08.252977224+01:00 [torrust_index::web::api::server][INFO] Starting API server with net config: 0.0.0.0:3001 ...
2024-06-07T15:35:08.253260311+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer API server listening on http://127.0.0.1:3002
2024-06-07T15:35:08.254122817+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Running tracker statistics importer every 2000 milliseconds ...
2024-06-07T15:35:08.254518031+01:00 [torrust_index::web::api::server][INFO] API server listening on http://0.0.0.0:3001
2024-06-07T15:35:08.284476791+01:00 [Tracker Stats Importer][INFO] Importing 1 torrents statistics from tracker udp://localhost:6969 ...

New output:

$ cargo run
    Blocking waiting for file lock on build directory
   Compiling torrust-index v3.0.0-alpha.3-develop (/home/josecelano/Documents/github/committer/me/torrust/torrust-index)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 52.26s
     Running `target/debug/torrust-index`
Loading configuration from default configuration file: `./share/default/config/index.development.sqlite3.toml` ...
2024-06-07T16:50:05.192713Z  INFO torrust_index::bootstrap::logging: logging initialized.
2024-06-07T16:50:05.352161Z  INFO torrust_index::web::api::server: TLS not enabled
2024-06-07T16:50:05.352303Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer launcher started
2024-06-07T16:50:05.352318Z  INFO torrust_index::web::api::server: Starting API server with net config: 0.0.0.0:3001 ...
2024-06-07T16:50:05.352363Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer cronjob starting ...
2024-06-07T16:50:05.352828Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer API server listening on http://127.0.0.1:3002
2024-06-07T16:50:05.353605Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Running tracker statistics importer every 2000 milliseconds ...
2024-06-07T16:50:05.356876Z  INFO torrust_index::web::api::server: API server listening on http://0.0.0.0:3001
2024-06-07T16:50:05.428304Z  INFO Tracker Stats Importer: Importing 1 torrents statistics from tracker udp://localhost:6969 ...

We will migrate logging from `log` to `tracing` crate.
@josecelano josecelano added this to the v3.0.0 milestone Jun 7, 2024
@josecelano josecelano self-assigned this Jun 7, 2024
@josecelano josecelano marked this pull request as draft June 7, 2024 17:01
Current outpuit:

```output
$ cargo run
   Compiling torrust-index v3.0.0-alpha.3-develop (/home/josecelano/Documents/github/committer/me/torrust/torrust-index)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 12.31s
     Running `target/debug/torrust-index`
Loading configuration from default configuration file: `./share/default/config/index.development.sqlite3.toml` ...
2024-06-07T15:35:08.192302724+01:00 [torrust_index::bootstrap::logging][INFO] logging initialized.
2024-06-07T15:35:08.252784599+01:00 [torrust_index::web::api::server][INFO] TLS not enabled
2024-06-07T15:35:08.252892290+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer launcher started
2024-06-07T15:35:08.252979221+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer cronjob starting ...
2024-06-07T15:35:08.252977224+01:00 [torrust_index::web::api::server][INFO] Starting API server with net config: 0.0.0.0:3001 ...
2024-06-07T15:35:08.253260311+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Tracker statistics importer API server listening on http://127.0.0.1:3002
2024-06-07T15:35:08.254122817+01:00 [torrust_index::console::cronjobs::tracker_statistics_importer][INFO] Running tracker statistics importer every 2000 milliseconds ...
2024-06-07T15:35:08.254518031+01:00 [torrust_index::web::api::server][INFO] API server listening on http://0.0.0.0:3001
2024-06-07T15:35:08.284476791+01:00 [Tracker Stats Importer][INFO] Importing 1 torrents statistics from tracker udp://localhost:6969 ...
```

New output:

```output
$ cargo run
    Blocking waiting for file lock on build directory
   Compiling torrust-index v3.0.0-alpha.3-develop (/home/josecelano/Documents/github/committer/me/torrust/torrust-index)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 52.26s
     Running `target/debug/torrust-index`
Loading configuration from default configuration file: `./share/default/config/index.development.sqlite3.toml` ...
2024-06-07T16:50:05.192713Z  INFO torrust_index::bootstrap::logging: logging initialized.
2024-06-07T16:50:05.352161Z  INFO torrust_index::web::api::server: TLS not enabled
2024-06-07T16:50:05.352303Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer launcher started
2024-06-07T16:50:05.352318Z  INFO torrust_index::web::api::server: Starting API server with net config: 0.0.0.0:3001 ...
2024-06-07T16:50:05.352363Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer cronjob starting ...
2024-06-07T16:50:05.352828Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Tracker statistics importer API server listening on http://127.0.0.1:3002
2024-06-07T16:50:05.353605Z  INFO torrust_index::console::cronjobs::tracker_statistics_importer: Running tracker statistics importer every 2000 milliseconds ...
2024-06-07T16:50:05.356876Z  INFO torrust_index::web::api::server: API server listening on http://0.0.0.0:3001
2024-06-07T16:50:05.428304Z  INFO Tracker Stats Importer: Importing 1 torrents statistics from tracker udp://localhost:6969 ...
```
@josecelano josecelano force-pushed the 621-move-from-log-to-tracing-crate branch from f7f9aee to f6bace6 Compare June 7, 2024 17:07
@josecelano josecelano marked this pull request as ready for review June 7, 2024 17:22
@josecelano
Copy link
Member Author

ACK f6bace6

@josecelano josecelano linked an issue Jun 7, 2024 that may be closed by this pull request
@josecelano
Copy link
Member Author

Hi @da2ce7 I did the minimum needed for the migration. I haven not added the styles (default, pretty, json) you added in your PR in the tracker. We can create a new issue for that it's also a breaking change for the config file.

@josecelano josecelano merged commit ea28777 into torrust:develop Jun 10, 2024
13 checks passed
Copy link
Contributor

@mario-nt mario-nt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move from log to tracing crate
2 participants