bun-logger - v1.1.0
    Preparing search index...

    Function getLogLevel

    • Internal

      Determines the log level based on the provided input or environment variables.

      env.LOG_LEVEL can be set to one of the following values (case-insensitive):

      • none: Disables all logging.
      • all, verbose, debug: Enables all log levels (verbose, info, warnings, errors).
      • info, default, normal: Enables info, warnings, and errors, but disables verbose logging. (This is the default log level if no environment variable is set.)
      • warn, warning, warnings: Enables warnings and errors, but disables verbose and info logging.
      • error, errors: Enables only error logging, disabling verbose, info, and warnings.

      The env.LOG_ONLY variable can be used to enable only a specific log level (case-insensitive):

      • verbose or debug: Enables only verbose logging.
      • info: Enables only info logging.
      • warn, warning, or warnings: Enables only warnings logging.
      • error or errors: Enables only error logging.

      Additionally, individual log levels can be overridden using the following environment variables:

      • env.LOG_VERBOSE: Set to true to enable verbose logging or false to disable it.
      • env.LOG_INFO: Set to true to enable info logging or false to disable it.
      • env.LOG_WARNINGS: Set to true to enable warnings logging or false to disable it.
      • env.LOG_ERRORS: Set to true to enable error logging or false to disable it.

      Parameters

      Returns LogLevel

      The log level for Logger

      If logLevel parameter is provided, it will override the corresponding log levels determined by the environment variables while keeping the others at their default or previously set values.

      • Logger for details on how the log levels are used in the Logger class.
      • LogLevel for details on the structure of the LogLevel type.