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

add config to choose pretty/ndjson #20

Open
lagudomeze opened this issue Sep 3, 2020 · 3 comments
Open

add config to choose pretty/ndjson #20

lagudomeze opened this issue Sep 3, 2020 · 3 comments

Comments

@lagudomeze
Copy link

pub fn with_level(level: log::LevelFilter) {
    #[cfg(target_arch = "wasm32")]
    wasm::start(level);

    #[cfg(not(target_arch = "wasm32"))]
    {
        // Use ndjson in release mode, pretty logging while debugging.
       // here add some cfg! to choose pretty/ndjson
        if cfg!(debug_assertions) {
            pretty::start(level);
        } else {
            ndjson::start(level);
        }
    }
}
@lrlna
Copy link
Owner

lrlna commented Sep 8, 2020

hey @lagudomeze ! To make sure I understand this correctly, you're asking for an explicit feature attribute to set for pretty logging? Meaning you'd want pretty logging in production? Would be curious to hear your use case for this.

When thinking about this, I expected parseable logs (for this lib it's ndjson) in production.

@Fishrock123
Copy link
Contributor

#23 should address this

@lolo32
Copy link

lolo32 commented Jul 27, 2021

Hi @lrlna , it would be great if it will be possible to specify timestamp in pretty print too, and to change timestamp unit (seconds, milli, micro or nano)

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

4 participants