Skip to content

slog_scope's NoGlobalLoggerSet panic a bad default #169

@pjenvey

Description

@pjenvey

After an older gitter conversation, slog_scope's default global logger was changed to default to panic!()ing when the logger guard goes out of scope.

I think this is a bad default, especially for test suites. It's not uncommon to startup/teardown logging during tests. slog could intercept something before your first test is run (which it'll just Discard), then after the first scope tear down, these intercepts suddenly become panic!()s.

log messages might trigger panics from obscure places (I've seen one triggered from a lazy_static! block). They could be triggered differently depending on debug/release builds (the former might enable debug! calls). Tracking down these panics from the log system is not always a straightforward task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions