Skip to main content

publicLogger

Index

Constructors

publicconstructor

Methods

publicenabled

  • Returns true if the given level is enabled in logger.


    Parameters

    Returns boolean

publicgetLevel

publicgetWriter

publiclog

  • log(level: LogLevel, message: string, options?: Partial<Omit<Log, level | message | loggerLevel>>): void
  • @example

    Basic message

    logger.log(LogLevel.Info, "basic message");
    @example

    Error

    logger.log(LogLevel.Error, "error log", {
    error: new Error("error cause")
    });
    @example

    Data

    logger.log(LogLevel.Info, "log with data", {
    data: {
    foo: "bar"
    }
    });

    Parameters

    • level: LogLevel
    • message: string
    • options: Partial<Omit<Log, level | message | loggerLevel>> = {}

    Returns void

publicsetLevel

  • Sets logger level.


    Parameters

    Returns void

publicsetWriter

  • Sets writer of logger.


    Parameters

    Returns void