nim-codex/tests/logging.nim
markspanbroek 086b5c3914
[build] fix: ignore logging when running singular tests (#369)
* [build] fix: ignore logging when running singular tests

Ensures that logging is ignored at runtime when running
individual tests using `nim c -r tests/...`

* [build] Allow tests to be run with -d:chronicles_log_level

When running tests with chronicles_log_level set, do not
hide the the logs.
2023-03-16 15:32:09 +01:00

10 lines
189 B
Nim

import pkg/chronicles
proc ignoreLogging(level: LogLevel, message: LogOutputStr) =
discard
defaultChroniclesStream.output.writer = ignoreLogging
{.warning[UnusedImport]:off.}
{.used.}