Provide a logging service for this system to report into. Attach an instance to ValidationServices.loggerService.

interface ILoggerService {
    minLevel: LoggingLevel;
    chainedLogger: null | ILoggerService;
    serviceName: string;
    dispose(): void;
    log(level, gatherFn): void;
    logError(error, gatherFn): void;
}

Hierarchy (view full)

Implemented by

Properties

minLevel: LoggingLevel

Control which levels are output.

chainedLogger: null | ILoggerService

Reference to another ILogger implementation that gets called after the console's logging. Optional. Will only be called if this logger instance has level >= minLevel or an override. Its own MinLevel will be changed to Debug because this logger expects chainedLogger to output all log entries. However, you can set the minLevel on chainedLogger after this assignment to control what it outputs.

serviceName: string

Methods

  • If the user needs to abandon this instance, they should use this to clean up active resources (like timers) and to release memory that would stall the garbage collector from disposing this object. It should assign any object reference to undefined as a strong indicator that the object has been disposed.

    Returns void

  • Create a new log entry if the level is at or above the minimum level. The function is only called if the level is at or above the minimum level, avoiding any processing that would be done to create its data. The intent is to be performant when the log level is set to a higher level.

    Parameters

    Returns void

Generated using TypeDoc v0.25.12