mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-15 02:42:38 +00:00
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:
@@ -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))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user