LoggingExtras.jl
LoggingExtras.jl copied to clipboard
FileLogger add level argument to match SimpleLogger
With Logging.SimpleLogger you can do
SimpleLogger(logstream, Logging.Info)
It would be convenient if LoggingExtras.FileLogger allowed level to be set in the same way so it works as a drop-in replacement, ie
FileLogger(logstream, Logging.Info)
FileLogger("my_logfile.txt", Logging.Info)
edit: perhaps this is just a documentation request, the equivalent is (?):
LoggingExtras.MinLevelLogger(
LoggingExtras.FileLogger(logstream, always_flush=true),
Logging.Info
)
This is indeed exactly equivalent to wrapping in a MinLevelLogger, and that is the preferred way to do this.
Feel free to open a documentation PR, that would make a decent example to add under the MinLevelLogger