Integrate tracing (#6339)

Tracing Integration
- [reference](5bbf1859e9/projects/project-ideas.md (L297))


  - [x] replace slog & log with tracing throughout the codebase
- [x] implement custom crit log
- [x] make relevant changes in the formatter
- [x] replace sloggers
- [x] re-write SSE logging components

cc: @macladson @eserilev
This commit is contained in:
ThreeHrSleep
2025-03-13 04:01:05 +05:30
committed by GitHub
parent f23f984f85
commit d60c24ef1c
241 changed files with 9485 additions and 9328 deletions

View File

@@ -18,6 +18,7 @@ use parse_ssz::run_parse_ssz;
use std::path::PathBuf;
use std::process;
use std::str::FromStr;
use tracing_subscriber::filter::LevelFilter;
use types::{EthSpec, EthSpecId};
fn main() {
@@ -643,24 +644,31 @@ fn main() {
}
fn run<E: EthSpec>(env_builder: EnvironmentBuilder<E>, matches: &ArgMatches) -> Result<(), String> {
let (env_builder, _file_logging_layer, _stdout_logging_layer, _sse_logging_layer_opt) =
env_builder
.multi_threaded_tokio_runtime()
.map_err(|e| format!("should start tokio runtime: {:?}", e))?
.init_tracing(
LoggerConfig {
path: None,
debug_level: LevelFilter::TRACE,
logfile_debug_level: LevelFilter::TRACE,
log_format: None,
logfile_format: None,
log_color: true,
logfile_color: false,
disable_log_timestamp: false,
max_log_size: 0,
max_log_number: 0,
compression: false,
is_restricted: true,
sse_logging: false, // No SSE Logging in LCLI
extra_info: false,
},
"",
);
let env = env_builder
.multi_threaded_tokio_runtime()
.map_err(|e| format!("should start tokio runtime: {:?}", e))?
.initialize_logger(LoggerConfig {
path: None,
debug_level: String::from("trace"),
logfile_debug_level: String::from("trace"),
log_format: None,
logfile_format: None,
log_color: false,
disable_log_timestamp: false,
max_log_size: 0,
max_log_number: 0,
compression: false,
is_restricted: true,
sse_logging: false, // No SSE Logging in LCLI
})
.map_err(|e| format!("should start logger: {:?}", e))?
.build()
.map_err(|e| format!("should build env: {:?}", e))?;