Skip to content

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

@ozataman

Description

@ozataman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions