Skip to content

Commit

Permalink
Merge torrust#888: Move from log to tracing crate
Browse files Browse the repository at this point in the history
ec88dbf chore(deps): remove unused dependencies log and fern (Jose Celano)
d6fd11a test: [torrust#884] add test for parsing array of services from app logs (Jose Celano)
7de2595 chore(deps): [torrust#884] remove unused crate log (Jose Celano)
69f100a refactor: [torrust#884] move from log to tracing crate (Jose Celano)
6e06b2e refactor: [torrust#884] move from log to tracing crate (Jose Celano)
3ccc0e4 chore(deps): add cargo dependency tracing (Jose Celano)

Pull request description:

  Move from `log` to `tracing` crate.

ACKs for top commit:
  josecelano:
    ACK ec88dbf

Tree-SHA512: ce468cc920555f821067d24d7a4ca23313f521ad01faaf8e34c1d581bdf43c9a83a9ef3119ab5adf1d4d265befcfe1100cee7ce1e52d67ddabbf342b7b52713a
  • Loading branch information
josecelano committed Jun 10, 2024
2 parents 613a1df + ec88dbf commit dc171c1
Show file tree
Hide file tree
Showing 42 changed files with 262 additions and 164 deletions.
94 changes: 82 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ clap = { version = "4", features = ["derive", "env"] }
crossbeam-skiplist = "0.1"
dashmap = "5.5.3"
derive_more = "0"
fern = "0"
figment = "0.10.18"
futures = "0"
futures-util = "0.3.30"
Expand All @@ -52,7 +51,6 @@ http-body = "1.0.0"
hyper = "1"
hyper-util = { version = "0.1.3", features = ["http1", "http2", "tokio"] }
lazy_static = "1"
log = { version = "0", features = ["release_max_level_info"] }
multimap = "0"
parking_lot = "0.12.1"
percent-encoding = "2"
Expand Down Expand Up @@ -80,6 +78,7 @@ tower = { version = "0.4.13", features = ["timeout"] }
tower-http = { version = "0", features = ["compression-full", "cors", "propagate-header", "request-id", "trace"] }
trace = "0"
tracing = "0"
tracing-subscriber = { version = "0.3.18", features = ["json"] }
url = "2"
uuid = { version = "1", features = ["v4"] }
zerocopy = "0.7.33"
Expand Down
2 changes: 1 addition & 1 deletion packages/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Info {
let env_var_config_toml_path = ENV_VAR_CONFIG_TOML_PATH.to_string();

let config_toml = if let Ok(config_toml) = env::var(env_var_config_toml) {
println!("Loading configuration from environment variable {config_toml} ...");
println!("Loading configuration from environment variable:\n {config_toml}");
Some(config_toml)
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion packages/located-error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rust-version.workspace = true
version.workspace = true

[dependencies]
log = { version = "0", features = ["release_max_level_info"] }
tracing = "0.1.40"

[dev-dependencies]
thiserror = "1"
2 changes: 1 addition & 1 deletion packages/located-error/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use std::error::Error;
use std::panic::Location;
use std::sync::Arc;

use log::debug;
use tracing::debug;

pub type DynError = Arc<dyn std::error::Error + Send + Sync>;

Expand Down
4 changes: 4 additions & 0 deletions share/default/config/tracker.e2e.container.sqlite3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ ssl_key_path = "/var/lib/torrust/tracker/tls/localhost.key"
[http_api]
ssl_cert_path = "/var/lib/torrust/tracker/tls/localhost.crt"
ssl_key_path = "/var/lib/torrust/tracker/tls/localhost.key"

[health_check_api]
# Must be bound to wildcard IP to be accessible from outside the container
bind_address = "0.0.0.0:1313"
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
//! - Tracker REST API: the tracker API can be enabled/disabled.
use std::sync::Arc;

use log::warn;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::Configuration;
use tracing::warn;

use crate::bootstrap::jobs::{health_check_api, http_tracker, torrent_cleanup, tracker_apis, udp_tracker};
use crate::servers::registar::Registar;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/health_check_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
//! Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration)
//! for the API configuration options.

use log::info;
use tokio::sync::oneshot;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::HealthCheckApi;
use tracing::info;

use super::Started;
use crate::servers::health_check_api::server;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/http_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use std::net::SocketAddr;
use std::sync::Arc;

use axum_server::tls_rustls::RustlsConfig;
use log::info;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::HttpTracker;
use tracing::info;

use super::make_rust_tls;
use crate::core;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ use std::panic::Location;
use std::sync::Arc;

use axum_server::tls_rustls::RustlsConfig;
use log::info;
use thiserror::Error;
use torrust_tracker_configuration::TslConfig;
use torrust_tracker_located_error::{DynError, LocatedError};
use tracing::info;

/// Error returned by the Bootstrap Process.
#[derive(Error, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/torrent_cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
use std::sync::Arc;

use chrono::Utc;
use log::info;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::v1::core::Core;
use tracing::info;

use crate::core;

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/tracker_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ use std::net::SocketAddr;
use std::sync::Arc;

use axum_server::tls_rustls::RustlsConfig;
use log::info;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::{AccessTokens, HttpApi};
use tracing::info;

use super::make_rust_tls;
use crate::core;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/jobs/udp_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
//! > for the configuration options.
use std::sync::Arc;

use log::debug;
use tokio::task::JoinHandle;
use torrust_tracker_configuration::UdpTracker;
use tracing::debug;

use crate::core;
use crate::servers::registar::ServiceRegistrationForm;
Expand Down
Loading

0 comments on commit dc171c1

Please sign in to comment.