Singleton logger for the SoHL system.

Wraps the console with severity levels (info, warn, error, debug), threshold filtering, localized and timestamped message prefixes including the source-mapped call site, optional Foundry UI notifications (the ui* methods), and error chaining via Hooks.onError.

Accessors

Methods

  • Log a message at DEBUG severity.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Log a message at ERROR severity.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Inspect the current stack trace to identify the caller of the logging API (the first frame outside SohlLogger) and resolve it, source-mapping the location when possible.

    Returns LogCallerInfo

    Parsed LogCallerInfo; falls back to anonymous/unknown placeholders if the frame cannot be parsed.

  • Log a message at INFO severity.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Core logging routine used by all the convenience methods.

    Localizes and interpolates message, builds a level/timestamp/caller prefix, optionally reports an associated error (directly or via Hooks.onError), then — if the message passes the threshold and a notifyLevel is set — surfaces a Foundry UI notification.

    Parameters

    • message: string = ""

      The message key or text (localized and interpolated with any extra options keys).

    • options: Partial<LogOptions> = {}

      Logging options; see LogOptions. Defaults to an INFO-level console-only message.

    Returns void

  • Set the minimum severity to emit. Invalid levels are rejected with a console warning and leave the current threshold unchanged.

    Parameters

    • level: string

      The desired log level (or its string value).

    Returns void

  • Log at DEBUG severity and also request a DEBUG UI notification.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Log at ERROR severity and also show an ERROR Foundry UI notification.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Log at INFO severity and also show an INFO Foundry UI notification.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Log at WARN severity and also show a WARN Foundry UI notification.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void

  • Log a message at WARN severity.

    Parameters

    • message: string

      The message key or text.

    • Optionaldata: PlainObject

      Optional interpolation values.

    Returns void