Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CallbackLogger

A logger that calls a callback function.

Hierarchy

Index

Constructors

constructor

  • Create a new CallbackLogger instance.

    Parameters

    • callback: Function

      The callback that should be used to log messages.

    Returns CallbackLogger

Properties

callback

callback: Function

This loggers callback function

errorCount

errorCount: number = 0

How many error messages have been logged?

Methods

diagnostic

  • diagnostic(diagnostic: Diagnostic): void
  • Print the given TypeScript log message.

    Parameters

    • diagnostic: Diagnostic

      The TypeScript message that should be logged.

    Returns void

diagnostics

  • diagnostics(diagnostics: ReadonlyArray<Diagnostic>): void
  • Print the given TypeScript log messages.

    Parameters

    • diagnostics: ReadonlyArray<Diagnostic>

      The TypeScript messages that should be logged.

    Returns void

error

  • error(text: string, ...args: string[]): void
  • Log the given error.

    Parameters

    • text: string

      The error that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given error.

    Returns void

hasErrors

  • hasErrors(): boolean

log

  • log(message: string, level?: LogLevel, newLine?: boolean): void
  • Print a log message.

    Parameters

    • message: string

      The message itself.

    • Default value level: LogLevel = LogLevel.Info

      The urgency of the log message.

    • Optional newLine: boolean

      Should the logger print a trailing whitespace?

    Returns void

resetErrors

  • resetErrors(): void

success

  • success(text: string, ...args: string[]): void
  • Log the given success message.

    Parameters

    • text: string

      The message that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given message.

    Returns void

verbose

  • verbose(text: string, ...args: string[]): void
  • Log the given verbose message.

    Parameters

    • text: string

      The message that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given message.

    Returns void

warn

  • warn(text: string, ...args: string[]): void
  • Log the given warning.

    Parameters

    • text: string

      The warning that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given warning.

    Returns void

write

  • write(text: string, ...args: string[]): void
  • Log the given message.

    Parameters

    • text: string

      The message that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given message.

    Returns void

writeln

  • writeln(text: string, ...args: string[]): void
  • Log the given message with a trailing whitespace.

    Parameters

    • text: string

      The message that should be logged.

    • Rest ...args: string[]

      The arguments that should be printed into the given message.

    Returns void

Generated using TypeDoc