deno_std icon indicating copy to clipboard operation
deno_std copied to clipboard

LogLevel redundant setup

Open mariofdezzz opened this issue 5 months ago • 0 comments

Is your feature request related to a problem? Please describe.

LogLevel setup seems confusing to me. I need to use "DEBUG" keyword two times in order to lower default level. It should be place only one time.

log.setup({
  handlers: {
    default: new log.ConsoleHandler("DEBUG"),
  },
  loggers: {
    default: {
      level: "DEBUG",
      handlers: ['default'],
    },
  },
})

// === OR ===

this.logger = new log.Logger(
  'name',
  "DEBUG",
  {
    handlers: [
      new log.ConsoleHandler("DEBUG"),
    ],
  },
)

Whats the purpose of requiring handler LogLevel too? Am I missing something?

Describe the solution you'd like

Remove LogLevel on handlers

Describe alternatives you've considered

mariofdezzz avatar Sep 17 '24 17:09 mariofdezzz