Options
All
  • Public
  • Public/Protected
  • All
Menu

Default configuration, can be used to initially set a different default configuration on the CategoryServiceFactory. This will be applied to all categories already registered (or registered in the future). Can also be applied to one Category (and childs).

Hierarchy

Index

Constructors

constructor

  • Create a new instance

    Parameters

    • Default value logLevel: LogLevel = LogLevel.Error

      Log level for all loggers, default is LogLevel.Error

    • Default value loggerType: LoggerType = LoggerType.Console

      Where to log, default is LoggerType.Console

    • Default value logFormat: CategoryLogFormat = new CategoryLogFormat()

      What logging format to use, use default instance, for default values see CategoryLogFormat.

    • Default value callBackLogger: function | null = null

      Optional callback, if LoggerType.Custom is used as loggerType. In that case must return a new Logger instance. It is recommended to extend AbstractCategoryLogger to make your custom logger.

    Returns CategoryConfiguration

Accessors

callBackLogger

  • get callBackLogger(): function | null

formatterLogMessage

  • get formatterLogMessage(): function | null
  • set formatterLogMessage(value: function | null): void
  • Get the formatterLogMessage function, see comment on the setter.

    Returns function | null

  • Set the default formatterLogMessage function, if set it is applied to all type of loggers except for a custom logger. By default this is null (not set). You can assign a function to allow custom formatting of a log message. Each log message will call this function then and expects your function to format the message and return a string. Will throw an error if you attempt to set a formatterLogMessage if the LoggerType is custom.

    Parameters

    • value: function | null

      The formatter function, or null to reset it.

    Returns void

logFormat

logLevel

loggerType

Methods

copy

Generated using TypeDoc