Skip to content

Commit 00fee9f

Browse files
committed
Disable Gossip-level logging at runtime
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.
1 parent ab9e317 commit 00fee9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/disk.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bitcoin::Network;
44
use chrono::Utc;
55
use lightning::routing::scoring::{ProbabilisticScorer, ProbabilisticScoringDecayParameters};
66
use lightning::util::hash_tables::{new_hash_map, HashMap};
7-
use lightning::util::logger::{Logger, Record};
7+
use lightning::util::logger::{Level, Logger, Record};
88
use lightning::util::ser::{Readable, ReadableArgs};
99
use std::fs;
1010
use std::fs::File;
@@ -28,6 +28,10 @@ impl FilesystemLogger {
2828
}
2929
impl Logger for FilesystemLogger {
3030
fn log(&self, record: Record) {
31+
if record.level == Level::Gossip {
32+
// Gossip-level logs are incredibly verbose, and thus we skip them by default.
33+
return;
34+
}
3135
let raw_log = record.args.to_string();
3236
let log = format!(
3337
"{} {:<5} [{}:{}] {}\n",

0 commit comments

Comments
 (0)