Options
All
  • Public
  • Public/Protected
  • All
Menu

Module logging/LogUtil

Index

Functions

getLoggerFor

  • getLoggerFor(loggable: string | Instance): Logger
  • Gets a logger instance for the given class instance.

    The returned type of logger depends on the configured LoggerFactory in {@link Setup}.

    The following shows a typical pattern on how to create loggers:

    class MyClass {
      protected readonly logger = getLoggerFor(this);
    }
    

    If no class is applicable, a logger can also be created as follows:

    const logger = getLoggerFor('MyFunction');
    

    Parameters

    • loggable: string | Instance

      A class instance or a class string name.

    Returns Logger

resetGlobalLoggerFactory

  • resetGlobalLoggerFactory(): void
  • Resets the global logger factory to undefined.

    This typically only needs to be called during testing. Call this at your own risk.

    Returns void

setGlobalLoggerFactory