Skip to content
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

Regression: No log output for format "%z", "%:z", "%Z" or "%+" #49

Closed
timokroeger opened this issue Sep 27, 2019 · 2 comments · Fixed by #50
Closed

Regression: No log output for format "%z", "%:z", "%Z" or "%+" #49

timokroeger opened this issue Sep 27, 2019 · 2 comments · Fixed by #50
Assignees
Labels

Comments

@timokroeger
Copy link

A logger configured with any timezone related output format does not work.
No output can be seen on the terminal for a TermLogger.
No output is written to the logfile for a WriteLogger.

Example:

// Setup logging: Use local time in RFC3339 format
let log_config = LogConfigBuilder::new()
    .set_time_to_local(true)
    .set_time_format_str("%Y-%m-%dT%H:%M:%S%.3f%:z")
    .build();

As soon as I remove the last "%:z" the logger works as expected.

Tested version: 0.7.3
Version 0.5 and 0.6 work just fine with those format specifiers.

@AlexanderThaller
Copy link

Have the same problem with this setup

fn main() {
    let config = simplelog::ConfigBuilder::new()
        .set_time_format("%+".to_string())
        .build();

    println!("config: {:#?}", config);

    if let Err(err) =
        simplelog::TermLogger::init(opt.log_level, config, simplelog::TerminalMode::Stderr)
    {
        eprintln!("can not initialize logger: {}", err);
        ::std::process::exit(1);
    }

    error!("test");

    info!("test");
}

@Drakulix
Copy link
Owner

Fix published as v0.7.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants