Skip to content

Commit 2c6cb55

Browse files
committed
feat: pass VERBOSE env var to challenge containers for debug logging
When VERBOSE=true, challenge containers will use: RUST_LOG=debug,hyper=info,h2=info,tower=info,tokio_postgres=debug Otherwise defaults to: RUST_LOG=info,term_challenge=debug
1 parent 57e17e6 commit 2c6cb55

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/challenge-orchestrator/src/docker.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,13 @@ impl DockerClient {
526526
// Pass through important environment variables from image defaults
527527
env.push("TASKS_DIR=/app/data/tasks".to_string());
528528
env.push("DATA_DIR=/data".to_string());
529-
env.push("RUST_LOG=info,term_challenge=debug".to_string());
529+
// Set RUST_LOG based on VERBOSE env var
530+
let rust_log = if std::env::var("VERBOSE").is_ok() {
531+
"debug,hyper=info,h2=info,tower=info,tokio_postgres=debug".to_string()
532+
} else {
533+
"info,term_challenge=debug".to_string()
534+
};
535+
env.push(format!("RUST_LOG={}", rust_log));
530536
// Force challenge server to listen on port 8080 (orchestrator expects this)
531537
env.push("PORT=8080".to_string());
532538
// For Docker-in-Docker: tasks are at /host-tasks on host (we mount below)

0 commit comments

Comments
 (0)