2 Commits
2.1.0 ... 2.1.2

2 changed files with 5 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
# Package # Package
version = "2.1.0" version = "2.1.2"
author = "Jonathan Bernard" author = "Jonathan Bernard"
description = "Wrapper around std/logging to provide namespaced logging." description = "Wrapper around std/logging to provide namespaced logging."
license = "MIT" license = "MIT"

View File

@@ -127,7 +127,6 @@ type
formatter*: LogMessageFormatter formatter*: LogMessageFormatter
const UninitializedConfigVersion = low(int) const UninitializedConfigVersion = low(int)
let JNULL = newJNull()
var consoleLogging {.global.}: LogWriterThreadState[ConsoleMessage] var consoleLogging {.global.}: LogWriterThreadState[ConsoleMessage]
var fileLogging {.global.}: LogWriterThreadState[FileMessage] var fileLogging {.global.}: LogWriterThreadState[FileMessage]
@@ -141,7 +140,7 @@ proc initLogMessage*(
lvl: Level, lvl: Level,
msg: string, msg: string,
err: Option[ref Exception] = none[ref Exception](), err: Option[ref Exception] = none[ref Exception](),
additionalData: JsonNode = JNULL): LogMessage = additionalData: JsonNode = newJNull()): LogMessage =
LogMessage( LogMessage(
scope: scope, scope: scope,
@@ -548,6 +547,9 @@ template notice*[L: Logger or Option[Logger], M](l: L, msg: M) =
template warn*[L: Logger or Option[Logger], M](l: L, msg: M) = template warn*[L: Logger or Option[Logger], M](l: L, msg: M) =
log(l, lvlWarn, msg) log(l, lvlWarn, msg)
template warn*[L: Logger or Option[Logger], M](l: L, err: ref Exception, msg: M) =
log(l, lvlWarn, err, msg)
template error*[L: Logger or Option[Logger], M](l: L, msg: M) = template error*[L: Logger or Option[Logger], M](l: L, msg: M) =
log(l, lvlError, msg) log(l, lvlError, msg)