Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LoggerSync

Abstract class definition for the creating custom loggers where the developer only has to handle the implementation

Inspired by PSR-3 created by the PHP-FIG team. Thanks!!

Hierarchy

Index

Methods

alertSync

  • alertSync(message: string, context?: object): any
  • Action must be taken immediately.

    Example: Entire website down, database unavailable, etc. This should trigger the SMS alerts and wake you up.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

criticalSync

  • criticalSync(message: string, context?: object): any
  • Critical conditions.

    Example: Application component unavailable, unexpected exception.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

debugSync

  • debugSync(message: string, context?: object): any
  • Detailed debug information.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

emergencySync

  • emergencySync(message: string, context?: object): any
  • System is unusable.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

errorSync

  • errorSync(message: string, context?: object): any
  • Runtime errors that do not require immediate action but should typically be logged and monitored.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

Protected implementationSync

  • implementationSync(level: string, message: string): any
  • Create the implementation of this specific logger

    Parameters

    • level: string

      The level of the log entry

    • message: string

      The message to log

    Returns any

infoSync

  • infoSync(message: string, context?: object): any
  • Interesting events.

    Example: User logs in, SQL logs.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

Protected interpolate

  • interpolate(message: string, context?: object): string
  • Method to handle interpolation to recursively combine a context with a message. Usually this is done directly with javascript. However, there maybe times when a piece of code would smell better using this version of interpolation.

    Parameters

    • message: string

      The message to use in the interpolation

    • Optional context: object

      The context data to use with the message

    Returns string

logSync

  • logSync(level: string, message: string, context?: object): any
  • Logs with an arbitrary level.

    Parameters

    • level: string

      The level of the log entry

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

noticeSync

  • noticeSync(message: string, context?: object): any
  • Normal but significant events.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

warningSync

  • warningSync(message: string, context?: object): any
  • Exceptional occurrences that are not errors.

    Example: Use of deprecated APIs, poor use of an API, undesirable things that are not necessarily wrong.

    Parameters

    • message: string

      The message to log

    • Optional context: object

      The context data to use with the message

    Returns any

Generated using TypeDoc