From 07724c4d4ab4b3bc72376f47a2d1dad51c05cf4e Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 30 Sep 2024 13:54:48 -0500 Subject: [PATCH] use default from std/logging --- src/hwylterm/logging.nim | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/hwylterm/logging.nim b/src/hwylterm/logging.nim index 57dd0a5..274ae55 100644 --- a/src/hwylterm/logging.nim +++ b/src/hwylterm/logging.nim @@ -33,7 +33,16 @@ type 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( fmtPrefix, fmtSep, fmtSuffix, levelStyle: string,