Skip to content

Commit 340b2a1

Browse files
graph, node: Warn when running a debug build
Prefix every log line with [DEBUG-BUILD] and emit a startup warning when graph-node is compiled without --release, so operators are not silently running a degraded build in production.
1 parent 2b4675a commit 340b2a1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

graph/src/log/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ where
9797

9898
fn format_custom(&self, record: &Record, values: &OwnedKVList) -> io::Result<()> {
9999
self.decorator.with_record(record, values, |mut decorator| {
100+
#[cfg(debug_assertions)]
101+
write!(decorator, "[DEBUG-BUILD] ")?;
102+
100103
decorator.start_timestamp()?;
101104
formatted_timestamp_local(&mut decorator)?;
102105
decorator.start_whitespace()?;

node/src/launcher.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,13 @@ pub async fn run(
413413
render_testament!(TESTAMENT)
414414
);
415415

416+
#[cfg(debug_assertions)]
417+
warn!(
418+
logger,
419+
"This is a DEBUG build — performance is severely degraded. \
420+
Use `cargo build --release` for production deployments."
421+
);
422+
416423
if !graph_server_index_node::PoiProtection::from_env(&ENV_VARS).is_active() {
417424
warn!(
418425
logger,

0 commit comments

Comments
 (0)