Class: ParsoidLogger

logger/ParsoidLogger~ParsoidLogger(env)

new ParsoidLogger(env)

...
Parameters:
Name Type Description
env MWParserEnvironment
Source:

Extends

Methods

_defaultBackend(logData) → {Promise}

Optional default backend.

Optional default backend.

Parameters:
Name Type Description
logData LogData
Overrides:
Source:
Returns:

Promise which is fulfilled when logging is complete.

Type
Promise

_defaultTracerBackend(logData) → {Promise}

Optional default tracing and debugging backend.

Optional default tracing and debugging backend.

Parameters:
Name Type Description
logData LogData
Overrides:
Source:
Returns:

Promise which is fulfilled when logging is complete.

Type
Promise

_getApplicableBackends(logData) → {Generator.<backendCallback>}

Gets all registered backends that apply to a particular logType.

Gets all registered backends that apply to a particular logType.

Parameters:
Name Type Description
logData LogData
Inherited From:
Source:
Returns:
Type
Generator.<backendCallback>

_routeToBackends(logData) → {Promise|undefined}

Routes log data to backends.

Routes log data to backends. If logData.logType is fatal, exits process after logging to all backends.

Parameters:
Name Type Description
logData LogData
Inherited From:
Source:
Returns:

A Promise that is fulfilled when all logging is complete, or undefined if no backend was applicable and the logType was not fatal (fast path common case).

Type
Promise | undefined

getDefaultBackend() → {backendCallback}

...

getDefaultTracerBackend() → {backendCallback}

...

log(logType) → {undefined|Promise}

Outputs logging and tracing information to different backends.

Outputs logging and tracing information to different backends.

Parameters:
Name Type Description
logType string
Inherited From:
Source:
Returns:

a Promise that will be fulfilled when all logging is complete; for efficiency undefined is returned if this logType is being ignored (the common case).

Type
undefined | Promise

registerBackend(logType, backend)

Registers a backend by adding it to the collection of backends.

Registers a backend by adding it to the collection of backends.

Parameters:
Name Type Description
logType RegExp
backend backendCallback

Backend to send logging / tracing info to.

Inherited From:
Source:

registerSampling(logType, percent)

Register sampling rates, in percent, for log types.

Register sampling rates, in percent, for log types.

Parameters:
Name Type Description
logType RegExp
percent number
Inherited From:
Source: