Skip to content

Commit

Permalink
Disable Gossip-level logging at runtime
Browse files Browse the repository at this point in the history
This used to be disabled at compile-time, but the feature was
removed as it didn't net substantial performance gain, so now we
disable them at runtime.
  • Loading branch information
TheBlueMatt committed Jan 10, 2025
1 parent ab9e317 commit 00fee9f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bitcoin::Network;
use chrono::Utc;
use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringDecayParameters};
use lightning::util::hash_tables::{new_hash_map, HashMap};
use lightning::util::logger::{Logger, Record};
use lightning::util::logger::{Level, Logger, Record};
use lightning::util::ser::{Readable, ReadableArgs};
use std::fs;
use std::fs::File;
Expand All @@ -28,6 +28,10 @@ impl FilesystemLogger {
}
impl Logger for FilesystemLogger {
fn log(&self, record: Record) {
if record.level == Level::Gossip {
// Gossip-level logs are incredibly verbose, and thus we skip them by default.
return;
}
let raw_log = record.args.to_string();
let log = format!(
"{} {:<5} [{}:{}] {}\n",
Expand Down

0 comments on commit 00fee9f

Please sign in to comment.