Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "wed/log"

Index

Type aliases

Log4JSMethod

Log4JSMethod: function

Type declaration

    • (...messages: any[]): void
    • Parameters

      • Rest ...messages: any[]

      Returns void

Variables

Const ajaxLogger

ajaxLogger: Logger = log4javascript.getLogger("wed")

Const debug

debug: Log4JSMethod = log.debug.bind(log)

Const error

error: Log4JSMethod = log.error.bind(log)

Const fatal

fatal: Log4JSMethod = log.fatal.bind(log)

Const info

info: Log4JSMethod = log.info.bind(log)

Const log

log: Logger = log4javascript.getLogger("wed.common")

Const popup

popup: PopUpAppender = new log4javascript.PopUpAppender(true)

Const trace

trace: Log4JSMethod = log.trace.bind(log)

Const warn

warn: Log4JSMethod = log.warn.bind(log)

Functions

addURL

  • addURL(url: string, headers?: Record<string, string>): AjaxAppender
  • This method adds an Ajax appender to the topmost logger defined by wed so that all messages are sent to the URL specified as a parameter. A server should be listening at that address.

    Parameters

    • url: string

      The URL for the location to send log messages.

    • Optional headers: Record<string, string>

      An object having (key, value) pairs which define header fields to set for communicating. One use for this parameter would be for instance to set the X-CSRFToken field when wed is being used on pages served by a Django server.

    Returns AjaxAppender

    The appender that was created to handle the URL. This may be used with removeAppender to remove an appender that is no longer used.

handle

  • handle(e: any): never
  • Handles an unhandled exception. In almost all cases where you have to deal with an unhandled exception, you want to interrupt the flow of execution. This function does this.

    throws

    {Handled} Always.

    Parameters

    • e: any

      The exception that is unhandled.

    Returns never

removeAppender

  • removeAppender(appender: AjaxAppender): void
  • Removes an appender from the logger. Flushes out any pending messages first.

    Parameters

    • appender: AjaxAppender

      The appender to remove.

    Returns void

showPopup

  • showPopup(): void
  • Shows the popup appender.

    Returns void

unhandled

  • Reports an unhandled exception. Avoids reporting the same exception more than once.

    Use this function only if it makes sense to not abort the current execution by throwing a new exception. In most cases you want to use handle instead of this function.

    Parameters

    • e: any

      The exception to report. This exception will not be reported if it happens to be a Handled object.

    Returns Handled

    A wrapper around the original exception.

wrap

  • wrap<T>(fn: T): T
  • Wraps a function into an unhandled exception logger. The exceptions caught are rethrown after being logged.

    Type parameters

    • T: function

    Parameters

    • fn: T

    Returns T

    The value returned by f.

Generated using TypeDoc