iggs-utils - v2.4.0
    Preparing search index...

    Class Logger

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Methods

    • Designates fine-grained informational events that are most useful to debug an application.

      Parameters

      Returns void

    • Designates very severe error events that will presumably lead the application to abort.

      Parameters

      Returns void

    • Designates informational messages that highlight the progress of the application at coarse-grained level.

      Parameters

      Returns void

    • Parameters

      • name: string

      Returns StepLogger

      a new StepLogger wrapping this logger.

      needs testing

      Creates a new StepLogger with the given name.

      const logger = new Logger('[main]');

      logger.info('creating a step logger');

      const step = logger.step('[step]');
      step.info('doing something...');
      step.finish();


      logger.info('after step logger has finished');

      // Output:
      // [2021-08-31T14:00:00.000Z] INFO: [main] creating a step logger
      // [2021-08-31T14:00:00.000Z] INFO: [main]:[step] started
      // [2021-08-31T14:00:00.000Z] INFO: [main]:[step] doing something...
      // [2021-08-31T14:00:00.000Z] INFO: [main]:[step] finished in 0ms
      // [2021-08-31T14:00:00.000Z] INFO: [main] after step logger has finished

    Properties

    logLevel: LogLevel = LogLevel.WARN
    logWriter: LogWriter = defaultLogWriter
    prefix: string = ''