Skip to content

Question: is it safe to use TermLogger across threads without additional synchronisation? #146

@cyqsimon

Description

@cyqsimon

After I call TermLogger::init at the start of the main thread then spin up multiple worker threads, is it safe to use the usual logging macros in these threads without additional synchronisation?

In other words, is it possible for two threads to print at the same time, and instead of producing two good lines, produce two interleaved lines of garbage? (I suspect no but just want confirmation.)

And lastly, what about SimpleLogger and WriteLogger? Do they behave the same?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions