Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Increase logging channel capacity #1570

Closed
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion boot_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ mod server;
pub use cli::cli_app;
use config::BootNodeConfig;

const LOG_CHANNEL_SIZE: usize = 2048;

/// Run the bootnode given the CLI configuration.
pub fn run(matches: &ArgMatches<'_>, debug_level: String) {
let debug_level = match debug_level.as_str() {
Expand All @@ -26,7 +28,9 @@ pub fn run(matches: &ArgMatches<'_>, debug_level: String) {
let decorator = slog_term::TermDecorator::new().build();
let decorator = logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
let drain = slog_term::FullFormat::new(decorator).build().fuse();
slog_async::Async::new(drain).build()
slog_async::Async::new(drain)
.chan_size(LOG_CHANNEL_SIZE)
.build()
};

let drain = match debug_level {
Expand Down
17 changes: 13 additions & 4 deletions lighthouse/environment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mod executor;
mod metrics;

pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";
const LOG_CHANNEL_SIZE: usize = 2048;

/// Builds an `Environment`.
pub struct EnvironmentBuilder<E: EthSpec> {
Expand Down Expand Up @@ -129,7 +130,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
match format.to_uppercase().as_str() {
"JSON" => {
let drain = slog_json::Json::default(std::io::stdout()).fuse();
slog_async::Async::new(drain).build()
slog_async::Async::new(drain)
.chan_size(LOG_CHANNEL_SIZE)
.build()
}
_ => return Err("Logging format provided is not supported".to_string()),
}
Expand All @@ -138,7 +141,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
let decorator =
logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
let drain = slog_term::FullFormat::new(decorator).build().fuse();
slog_async::Async::new(drain).build()
slog_async::Async::new(drain)
.chan_size(LOG_CHANNEL_SIZE)
.build()
};

let drain = match debug_level {
Expand Down Expand Up @@ -192,7 +197,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
match format.to_uppercase().as_str() {
"JSON" => {
let drain = slog_json::Json::default(file).fuse();
slog_async::Async::new(drain).build()
slog_async::Async::new(drain)
.chan_size(LOG_CHANNEL_SIZE)
.build()
}
_ => return Err("Logging format provided is not supported".to_string()),
}
Expand All @@ -201,7 +208,9 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
let decorator =
logging::AlignedTermDecorator::new(decorator, logging::MAX_MESSAGE_WIDTH);
let drain = slog_term::FullFormat::new(decorator).build().fuse();
slog_async::Async::new(drain).build()
slog_async::Async::new(drain)
.chan_size(LOG_CHANNEL_SIZE)
.build()
};

let drain = match debug_level {
Expand Down