status-im / nim-chronicles

A crafty implementation of structured logging for Nim.
Apache License 2.0
153 stars 20 forks source link

logScope doesn't apply to generics #121

Open Menduist opened 1 year ago

Menduist commented 1 year ago

test.nim:

import chronicles
export chronicles

logScope: topic = "test"

proc notgen* =
  info "ok"

proc zz*[T] =
  warn "oh no!"

test2.nim:

import test

notgen()
zz[int]() 

Output:

INF 2022-11-04 11:23:19.284+01:00 ok                                         tid=4340 topic=test
WRN 2022-11-04 11:23:19.284+01:00 oh no!                                     tid=4340