POSTLogger publishes log messages in batches to a URL supplied during its construction.

Be sure to call POSTLogger.destroy when you're done with the logger in order to avoid leaks.

Implements

Constructors

Properties

metadata: Record<string, string>

Methods

  • Calls [[debugFunction]] only if the log level is debug and emits the resulting string. Use the debug level to dump large or verbose messages that could slow down performance.

    Parameters

    • debugFunction: string | () => string

    Returns void

  • Emits an error message if the log level is equal to or lower than error level.

    Parameters

    • msg: string

    Returns void

  • Emits an info message if the log level is equal to or lower than info level.

    Parameters

    • msg: string

    Returns void

  • Emits a warning message if the log level is equal to or lower than warn level.

    Parameters

    • msg: string

    Returns void