Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Debugger<T>

Helper for creating a good debug experience for Ataraxia classes. Builds on top of debug but adds support for emitting errors as events.

Type parameters

  • T: object

Hierarchy

  • Debugger

Index

Constructors

Accessors

Methods

Constructors

constructor

  • new Debugger<T>(parent: T, namespace: string): Debugger<T>
  • Create a new instance.

    Type parameters

    • T: object

    Parameters

    • parent: T
      • object to use as this for emitted error events
    • namespace: string
      • the namespace to use for the debug logging

    Returns Debugger<T>

Accessors

enabled

  • get enabled(): boolean

namespace

  • get namespace(): string

onError

  • get onError(): Subscribable<T, [error: Error]>

Methods

error

  • error(error: Error, formatter?: any, ...args: any[]): void
  • Log and emit an error.

    Parameters

    • error: Error
      • error that occurred
    • formatter: any = 'An error has occurred:'
      • formatter
    • Rest ...args: any[]
      • arguments

    Returns void

log

  • log(formatter: any, ...args: any[]): void

Generated using TypeDoc