Skip to content

Commit

Permalink
Deprecate env_log flag in tracing layer (#5228)
Browse files Browse the repository at this point in the history
* deprecate terminal logs file in tracing layer

* sink writer
  • Loading branch information
eserilev authored Feb 19, 2024
1 parent c9702cb commit 4d62595
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions common/logging/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ impl TimeLatch {
}
}

pub fn create_tracing_layer(base_tracing_log_path: PathBuf, turn_on_terminal_logs: bool) {
pub fn create_tracing_layer(base_tracing_log_path: PathBuf) {
let filter_layer = match tracing_subscriber::EnvFilter::try_from_default_env()
.or_else(|_| tracing_subscriber::EnvFilter::try_new("warn"))
{
Expand Down Expand Up @@ -268,11 +268,7 @@ pub fn create_tracing_layer(base_tracing_log_path: PathBuf, turn_on_terminal_log

if let Err(e) = tracing_subscriber::fmt()
.with_env_filter(filter_layer)
.with_writer(move || {
tracing_subscriber::fmt::writer::OptionalWriter::<std::io::Stdout>::from(
turn_on_terminal_logs.then(std::io::stdout),
)
})
.with_writer(std::io::sink)
.finish()
.with(MetricsLayer)
.with(custom_layer)
Expand Down
4 changes: 1 addition & 3 deletions lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,7 @@ fn run<E: EthSpec>(

let path = tracing_log_path.clone().unwrap();

let turn_on_terminal_logs = matches.is_present("env_log");

logging::create_tracing_layer(path, turn_on_terminal_logs);
logging::create_tracing_layer(path);

// Allow Prometheus to export the time at which the process was started.
metrics::expose_process_start_time(&log);
Expand Down

0 comments on commit 4d62595

Please sign in to comment.