Skip to main content

Logger

Static singleton that represents the logging facility for Excalibur. Excalibur comes built-in with a ConsoleAppender and ScreenAppender. Derive from Appender to create your own logging appenders.

Index

Constructors

constructor

Properties

publicdefaultLevel

defaultLevel: LogLevel = LogLevel.Info

Gets or sets the default logging level. Excalibur will only log messages if equal to or above this level. Default: LogLevel.Info

Methods

publicaddAppender

  • Adds a new Appender to the list of appenders to write to


    Parameters

    Returns void

publicclearAppenders

  • clearAppenders(): void
  • Clears all appenders from the logger


    Returns void

publicdebug

  • debug(...args: any[]): void
  • Writes a log message at the LogLevel.Debug level


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicdebugOnce

  • debugOnce(...args: any[]): void
  • Writes a log message once at the LogLevel.Fatal level, if it sees the same args again it wont log


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicerror

  • error(...args: any[]): void
  • Writes a log message at the LogLevel.Error level


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicerrorOnce

  • errorOnce(...args: any[]): void
  • Writes a log message once at the LogLevel.Error level, if it sees the same args again it won't log


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicfatal

  • fatal(...args: any[]): void
  • Writes a log message at the LogLevel.Fatal level


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicfatalOnce

  • fatalOnce(...args: any[]): void
  • Writes a log message once at the LogLevel.Fatal level, if it sees the same args again it won't log


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicinfo

  • info(...args: any[]): void
  • Writes a log message at the LogLevel.Info level


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicinfoOnce

  • infoOnce(...args: any[]): void
  • Writes a log message once at the LogLevel.Info level, if it sees the same args again it wont log


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicwarn

  • warn(...args: any[]): void
  • Writes a log message at the LogLevel.Warn level


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicwarnOnce

  • warnOnce(...args: any[]): void
  • Writes a log message once at the LogLevel.Warn level, if it sees the same args again it won't log


    Parameters

    • rest...args: any[]

      Accepts any number of arguments

    Returns void

publicstaticgetInstance

  • Gets the current static instance of Logger


    Returns Logger