Skip to content

mirrord cli doesn't log when using RUST_LOG #3099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
aviramha opened this issue Feb 18, 2025 · 1 comment
Closed

mirrord cli doesn't log when using RUST_LOG #3099

aviramha opened this issue Feb 18, 2025 · 1 comment
Assignees

Comments

@aviramha
Copy link
Member

To reproduce:

RUST_LOG=mirrord=trace MIRRORD_PROGRESS_MODE=off mirrord exec sh

logs will start only from layer, not cli.
Bug seems to happen due to this code:

    // There are situations where even if running "ext" commands that shouldn't log, we want those
    // to log to be able to debug issues.
    let force_log = std::env::var("MIRRORD_FORCE_LOG")
        .ok()
        .and_then(|s| s.parse().ok())
        .unwrap_or(false);

    if force_log || init_ext_error_handler(command) {
        tracing_subscriber::registry()
            .with(tracing_subscriber::fmt::layer().with_writer(std::io::stderr))
            .with(tracing_subscriber::EnvFilter::from_default_env())
            .init();
    }
Copy link

linear bot commented Feb 18, 2025

@Razz4780 Razz4780 self-assigned this Feb 18, 2025
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

No branches or pull requests

2 participants