Skip to content
Discussion options

You must be logged in to vote

Hey, If you don’t care about log output in your tests, there are a few clean ways to avoid the logging overhead

Option 1 (Recommended): Initialize the logger, but don’t start the backend

You can keep your existing logging calls, create the logger with create_or_get_logger(...) but simply never call quill::Backend::start() / quill::Backend::stop()

As long as your test doesn’t enqueue more than ~2 GB of logs (which is extremely unlikely), this is perfectly safe.

Library is explicitly designed to handle this case:

your code can still push log records into the queue, but since the backend thread never starts, the records are never processed. This completely avoids backend startup/shutdown cos…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Monstermel
Comment options

Answer selected by Monstermel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants