Loxer - v3.0.0
    Preparing search index...

    Interface LoxerCore

    this is the main type of Loxer

    interface LoxerCore {
        init<M extends LoxerModules>(options?: LoxerOptions<M>): void;
        getModuleLevel(moduleId: string): LogLevel | undefined;
        history: (ErrorLox | OutputLox)[];
    }
    Index
    history: (ErrorLox | OutputLox)[]

    This is a list of all logs / boxes / errors that occurred in the past. It must be enabled by initialization.

    • is a reversed stack, so that the most recent element is at history[0]
    • the size of the history can be set at the LoxerConfig.historyCacheSize in the LoxerOptions.config declared in Loxer.init(options). It defaults to 50.
    • an error output event carries a snapshot of the history at the time of that error
      • if Loxer is not initialized, every log is cached until the initialization is done
      • call this as soon as possible.
      • ATTENTION: Do no conditionally leave out the initialization in order to avoid logging! All the logs will be cached anyways. If you want to conditionally disable Loxer then use one of the "disabled" options in the config(LoxerConfig) at the initialization
      • the given LoxerOptions.modules are checked against the LoxerModuleRegistry: while it is empty, any set of module ids is accepted; once modules are registered there, a registered id that is missing here and an id that is not registered are both compile errors - see RegisteredModules

      Type Parameters

      Parameters

      • Optionaloptions: LoxerOptions<M>

        Options for the configuration of Loxer

      Returns void

      • is dependent on the environment: returns actual level (prod || dev)
      • returns undefined if there is no corresponding module for the given moduleId
      • if the LoxerModuleRegistry is augmented, then probing an id that is deliberately not a registered module (to get the undefined) needs a cast: getModuleLevel(id as ModuleId)

      Parameters

      • moduleId: string

        the corresponding key of a module from LoxerOptions.modules declared in Loxer.init(options)

      Returns LogLevel | undefined