mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
add logging functionality for aligning key value pairs after message (#461)
* add logging functionality for aligning key value pairs after the main messages * move to own crate, change default message width to 40 * use FullFormat in validator_client (CompactFormat is not compatible with aligning) * move logging to eth2/utils/logging
This commit is contained in:
committed by
Paul Hauner
parent
6eac426ed8
commit
309b10c4a8
@@ -34,3 +34,4 @@ error-chain = "0.12.0"
|
||||
bincode = "^1.1.2"
|
||||
futures = "0.1.25"
|
||||
dirs = "2.0.1"
|
||||
logging = { path = "../eth2/utils/logging" }
|
||||
|
||||
@@ -24,7 +24,8 @@ pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
|
||||
fn main() {
|
||||
// Logging
|
||||
let decorator = slog_term::TermDecorator::new().build();
|
||||
let drain = slog_term::CompactFormat::new(decorator).build().fuse();
|
||||
let decorator = logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
|
||||
let drain = slog_term::FullFormat::new(decorator).build().fuse();
|
||||
let drain = slog_async::Async::new(drain).build().fuse();
|
||||
|
||||
// CLI
|
||||
|
||||
Reference in New Issue
Block a user