nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.22k stars 1.46k forks source link

in std/logging implement removeHandler #23757

Open steschuser opened 3 days ago

steschuser commented 3 days ago

Summary

In the std/logging module is a addHandler proc but a corresponding removeHandler seems to be missing

Description

I'd like to remove already added handlers :)

Alternatives

No response

Examples

import std/logging

var consoleLog = newConsoleLogger()
var fileLog = newFileLogger("errors.log", levelThreshold=lvlError)
var rollingLog = newRollingFileLogger("rolling.log")

addHandler(consoleLog)
removeHandler(consoleLog)

addHandler(fileLog)
removeHandler(fileLog)

addHandler(rollingLog)

Links

https://nim-lang.org/docs/logging.html#addHandler%2CLogger