hslogger icon indicating copy to clipboard operation
hslogger copied to clipboard

Logger.handle should bubble up via Logger's parents, not parent Loggers' handlers directly

Open ozataman opened this issue 11 years ago • 0 comments

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 Handlers 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 to WARNING 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.

ozataman avatar Jan 26 '14 22:01 ozataman