|
|
@ -391,6 +391,17 @@ proc setThreshold*(ls: ThreadLocalLogService, scope: string, lvl: Level) {.gcsaf
|
|
|
|
setThreshold(ls[], scope, lvl)
|
|
|
|
setThreshold(ls[], scope, lvl)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc setThresholds*(ls: var LogService, thresholds: TableRef[string, Level]) {.gcsafe.} =
|
|
|
|
|
|
|
|
withLock ls.global.lock:
|
|
|
|
|
|
|
|
for k,v in thresholds: ls.global.thresholds[k] = v
|
|
|
|
|
|
|
|
ls.global.configVersion.atomicInc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ensureFreshness(ls)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc setThresholds*(ls: ThreadLocalLogService, thresholds: TableRef[string, Level]) {.gcsafe.} =
|
|
|
|
|
|
|
|
setThresholds(ls[], thresholds)
|
|
|
|
|
|
|
|
|
|
|
|
proc getLogger*(
|
|
|
|
proc getLogger*(
|
|
|
|
ls: ThreadLocalLogService,
|
|
|
|
ls: ThreadLocalLogService,
|
|
|
|
scope: string,
|
|
|
|
scope: string,
|
|
|
@ -425,6 +436,12 @@ proc getLogger*(
|
|
|
|
else: none[Logger]()
|
|
|
|
else: none[Logger]()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc appenders*(ls: var LogService): seq[LogAppender] {.gcsafe.} =
|
|
|
|
|
|
|
|
for a in ls.appenders: result.add(clone(a))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc appenders*(ls: ThreadLocalLogService): seq[LogAppender] {.gcsafe.} =
|
|
|
|
|
|
|
|
ls[].appenders()
|
|
|
|
|
|
|
|
|
|
|
|
proc addAppender*(ls: var LogService, appender: LogAppender) {.gcsafe.} =
|
|
|
|
proc addAppender*(ls: var LogService, appender: LogAppender) {.gcsafe.} =
|
|
|
|
## Add a log appender to the global log service and refresh the local thread
|
|
|
|
## Add a log appender to the global log service and refresh the local thread
|
|
|
|
## state. The updated global state will trigger other threads to refresh
|
|
|
|
## state. The updated global state will trigger other threads to refresh
|
|
|
|