diff --git a/src/nimlsppkg/logger.nim b/src/nimlsppkg/logger.nim index 8bb437c..9d7eb03 100644 --- a/src/nimlsppkg/logger.nim +++ b/src/nimlsppkg/logger.nim @@ -7,26 +7,31 @@ let rollingLog = newRollingFileLogger(storage / "nimlsp.log") addHandler(rollingLog) template debugLog*(args: varargs[string, `$`]) = + bind debug when defined(debugLogging): debug join(args) flushFile rollingLog.file template infoLog*(args: varargs[string, `$`]) = + bind info when defined(debugLogging): info join(args) flushFile rollingLog.file template errorLog*(args: varargs[string, `$`]) = + bind error when defined(debugLogging): error join(args) template warnLog*(args: varargs[string, `$`]) = + bind warn when defined(debugLogging): warn join(args) type FrameDirection* = enum In, Out template frameLog*(direction: FrameDirection, args: varargs[string, `$`]) = + bind info let oldFmtStr = rollingLog.fmtStr case direction: of Out: rollingLog.fmtStr = "<< "