Skip to content

smite: add NyxLogger for debugging in Nyx mode#133

Merged
morehouse merged 1 commit into
masterfrom
nyx_logging
Jun 29, 2026
Merged

smite: add NyxLogger for debugging in Nyx mode#133
morehouse merged 1 commit into
masterfrom
nyx_logging

Conversation

@morehouse

Copy link
Copy Markdown
Owner

Enables scenario output to be printed in Nyx mode when SMITE_NYX_LOG is enabled.

This was helpful for debugging a timing difference when running in Nyx vs Docker.

Comment thread smite/src/nyx_log.rs Outdated
Comment on lines +45 to +55
match std::env::var("RUST_LOG").ok().as_deref() {
Some(v) => match v.trim().to_ascii_lowercase().as_str() {
"trace" => LevelFilter::Trace,
"debug" => LevelFilter::Debug,
"warn" => LevelFilter::Warn,
"error" => LevelFilter::Error,
"off" => LevelFilter::Off,
_ => LevelFilter::Info,
},
None => LevelFilter::Info,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think we can reuse the built-in parser here, like SimpleLogger does:

Suggested change
match std::env::var("RUST_LOG").ok().as_deref() {
Some(v) => match v.trim().to_ascii_lowercase().as_str() {
"trace" => LevelFilter::Trace,
"debug" => LevelFilter::Debug,
"warn" => LevelFilter::Warn,
"error" => LevelFilter::Error,
"off" => LevelFilter::Off,
_ => LevelFilter::Info,
},
None => LevelFilter::Info,
}
std::env::var("RUST_LOG")
.ok()
.and_then(|v| v.trim().parse().ok())
.unwrap_or(LevelFilter::Info)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks! Done.

Enables scenario output to be printed in Nyx mode when SMITE_NYX_LOG is
enabled.
@morehouse morehouse merged commit 4f5f695 into master Jun 29, 2026
5 checks passed
@morehouse morehouse deleted the nyx_logging branch June 29, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants