hslogger
hslogger copied to clipboard
Logger.handle should bubble up via Logger's parents, not parent Loggers' handlers directly
Shouldn't the semantics be such that the parent loggers are consulted per their log levels? The current implementation bypasses the parent loggers and goes to their Handler
s directly.
Consider that:
-
rootLogger
is initiated with a DEBUG level stderr logger - Therefore any logger in the system with a higher log level will implicitly log to stderr, even if the
rootLogger
level is set toWARNING
or anything higher. - Notice how this bypasses the sensical check "Does the parent have adequate log level for this message?" It is enough for the parent's
Handler
to have adequate level, which is confusing. - There is no easy way to turn this off - one is forced to overwrite rootLogger handlers with
setHandlers [] :: [GenericHandler Handle]
, which is just ugly.