Skip to content

Commit

Permalink
Merge commit 'd1d34b9490f99fa2052ffcff2bcf0edaf42d1bdd' into nbc-1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
etan-status committed Oct 3, 2023
2 parents 71556f8 + d1d34b9 commit fb4fce7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions chronicles.nim
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ when runtimeFilteringEnabled:
for topic in topics:
topicsArray.add newCall(topicStateIMPL, newLit(topic))

let lvl = newDotExpr(ident "LogLevel", ident $logLevel)
result.add quote do:
if not `topicsMatch`(LogLevel(`logLevel`), `topicsArray`):
if not `topicsMatch`(`lvl`, `topicsArray`):
break `chroniclesBlockName`
else:
template runtimeFilteringDisabledError =
Expand Down Expand Up @@ -290,12 +291,13 @@ macro logIMPL(lineInfo: static InstInfo,
# `setProperty` and `flushRecord`.
let
record = genSym(nskVar, "record")
lvl = newDotExpr(ident "LogLevel", ident $severity)
expandItIMPL = bindSym("expandItIMPL", brForceOpen)

code.add quote do:
var `record`: `RecordType`
prepareOutput(`record`, LogLevel(`severity`))
initLogRecord(`record`, LogLevel(`severity`), `topicsNode`, `eventName`)
prepareOutput(`record`, `lvl`)
initLogRecord(`record`, `lvl`, `topicsNode`, `eventName`)
# called tid even when it's a process id - this to avoid differences in
# logging between threads and no threads
when not defined(chronicles_disable_thread_id):
Expand Down

0 comments on commit fb4fce7

Please sign in to comment.