use default from std/logging

This commit is contained in:
Daylin Morgan 2024-09-30 13:54:48 -05:00
parent 7f638448b8
commit 07724c4d4a
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -33,7 +33,16 @@ type
fmtStrs: array[Level, string] fmtStrs: array[Level, string]
const defaultFlushThreshold = lvlAll const
defaultFlushThreshold = when NimMajor >= 2:
when defined(nimV1LogFlushBehavior): lvlError else: lvlAll
else:
when defined(nimFlushAllLogs): lvlAll else: lvlError
## The threshold above which log messages to file-like loggers
## are automatically flushed.
##
## By default, only error and fatal messages are logged,
## but defining ``-d:nimFlushAllLogs`` will make all levels be flushed
proc genFmtStr( proc genFmtStr(
fmtPrefix, fmtSep, fmtSuffix, levelStyle: string, fmtPrefix, fmtSep, fmtSuffix, levelStyle: string,