Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: please bring back log level name constructor where minLevel takes a string #251

Open
a-r-d opened this issue Aug 6, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@a-r-d
Copy link

a-r-d commented Aug 6, 2023

Description / Use Case for a Feature

I appears that this is gone from the new code. In the old code you could construct the logger with a string based level instead of a numeric value.

/**
 * All possible log levels
 * @public
 */
export interface ILogLevel {
  0: "silly";
  1: "trace";
  2: "debug";
  3: "info";
  4: "warn";
  5: "error";
  6: "fatal";
}


/**
 * Constructor: logger settings
 * all values are optional and will be pre-filled with default values
 * @public
 */
export interface ISettingsParam {
...

  /** Minimum output log level (e.g. debug), default: "silly" */
  minLevel?: TLogLevelName;

...
}

I believe this is a worse developer experience as a consumer because now in my environment file I can't simply set the log level to be "info" or "debug" or "warn". I have to set it to some ambiguous number.

e.g. - I have to set it to be "3" using the newer constructor. What does "3" mean? Nobody on my team knows unless they look it up in this repo.

@a-r-d a-r-d added the enhancement New feature or request label Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant