ConsoleSink
Defined in: packages/app-logger/src/console-sink.ts:122
A Console implementation backed by a Logger.
Implements the standard Console interface
(https://console.spec.whatwg.org/) plus the Node.js extensions
(https://nodejs.org/api/console.html#console_console).
group()/groupCollapsed() open a Logger scope (scope-start/
scope-end events) instead of maintaining a hand-rolled indentation stack —
any sink downstream of the Logger already knows how to nest/indent a
scope.
Implements
Section titled “Implements”Console
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConsoleSink(
logger,options?):ConsoleSink
Defined in: packages/app-logger/src/console-sink.ts:136
Parameters
Section titled “Parameters”logger
Section titled “logger”The logger to write to.
options?
Section titled “options?”Optional settings for the console sink.
Returns
Section titled “Returns”ConsoleSink
Properties
Section titled “Properties”Console
Section titled “Console”Console: {(
stdout,stderr?,ignoreErrors?):Console; (options):Console;prototype:Console; }
Defined in: packages/app-logger/src/console-sink.ts:411
Call Signature
Section titled “Call Signature”new Console(
stdout,stderr?,ignoreErrors?):Console
Parameters
Section titled “Parameters”stdout
Section titled “stdout”WritableStream
stderr?
Section titled “stderr?”WritableStream
ignoreErrors?
Section titled “ignoreErrors?”boolean
Returns
Section titled “Returns”Console
Call Signature
Section titled “Call Signature”new Console(
options):Console
Parameters
Section titled “Parameters”options
Section titled “options”ConsoleOptions
Returns
Section titled “Returns”Console
prototype
Section titled “prototype”prototype:
Console
Implementation of
Section titled “Implementation of”Console.Console
Methods
Section titled “Methods”assert()
Section titled “assert()”assert(
condition, …data):void
Defined in: packages/app-logger/src/console-sink.ts:169
Parameters
Section titled “Parameters”condition
Section titled “condition”unknown
…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.assert
clear()
Section titled “clear()”clear():
void
Defined in: packages/app-logger/src/console-sink.ts:191
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.clear
count()
Section titled “count()”count(
label):void
Defined in: packages/app-logger/src/console-sink.ts:324
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.count
countReset()
Section titled “countReset()”countReset(
label):void
Defined in: packages/app-logger/src/console-sink.ts:332
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.countReset
debug()
Section titled “debug()”debug(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:203
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.debug
dir(
item,options?):void
Defined in: packages/app-logger/src/console-sink.ts:309
Parameters
Section titled “Parameters”unknown
options?
Section titled “options?”InspectOptions
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.dir
dirxml()
Section titled “dirxml()”dirxml(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:314
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.dirxml
error()
Section titled “error()”error(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:208
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.error
group()
Section titled “group()”group(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:347
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.group
groupCollapsed()
Section titled “groupCollapsed()”groupCollapsed(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:353
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.groupCollapsed
groupEnd()
Section titled “groupEnd()”groupEnd():
void
Defined in: packages/app-logger/src/console-sink.ts:358
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.groupEnd
info()
Section titled “info()”info(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:213
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.info
log(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:218
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.log
profile()
Section titled “profile()”profile(
label?):void
Defined in: packages/app-logger/src/console-sink.ts:419
This method does not display anything unless used in the inspector. The console.profile()
method starts a JavaScript CPU profile with an optional label until profileEnd
is called. The profile is then added to the Profile panel of the inspector.
console.profile('MyLabel');// Some codeconsole.profileEnd('MyLabel');// Adds the profile 'MyLabel' to the Profiles panel of the inspector.Parameters
Section titled “Parameters”label?
Section titled “label?”string
Returns
Section titled “Returns”void
v8.0.0
Implementation of
Section titled “Implementation of”Console.profile
profileEnd()
Section titled “profileEnd()”profileEnd(
label?):void
Defined in: packages/app-logger/src/console-sink.ts:424
This method does not display anything unless used in the inspector. Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector. See profile for an example.
If this method is called without a label, the most recently started profile is stopped.
Parameters
Section titled “Parameters”label?
Section titled “label?”string
Returns
Section titled “Returns”void
v8.0.0
Implementation of
Section titled “Implementation of”Console.profileEnd
table()
Section titled “table()”table(
tabularData,properties?):void
Defined in: packages/app-logger/src/console-sink.ts:223
Parameters
Section titled “Parameters”tabularData
Section titled “tabularData”unknown
properties?
Section titled “properties?”string[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.table
time()
Section titled “time()”time(
label):void
Defined in: packages/app-logger/src/console-sink.ts:371
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.time
timeEnd()
Section titled “timeEnd()”timeEnd(
label):void
Defined in: packages/app-logger/src/console-sink.ts:393
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.timeEnd
timeLog()
Section titled “timeLog()”timeLog(
label, …data):void
Defined in: packages/app-logger/src/console-sink.ts:380
Parameters
Section titled “Parameters”string
…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.timeLog
timeStamp()
Section titled “timeStamp()”timeStamp(
label?):void
Defined in: packages/app-logger/src/console-sink.ts:414
This method does not display anything unless used in the inspector. The console.timeStamp()
method adds an event with the label 'label' to the Timeline panel of the inspector.
Parameters
Section titled “Parameters”label?
Section titled “label?”string
Returns
Section titled “Returns”void
v8.0.0
Implementation of
Section titled “Implementation of”Console.timeStamp
trace()
Section titled “trace()”trace(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:293
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.trace
warn()
Section titled “warn()”warn(…
data):void
Defined in: packages/app-logger/src/console-sink.ts:304
Parameters
Section titled “Parameters”…unknown[]
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”Console.warn
patchConsole()
Section titled “patchConsole()”
staticpatchConsole(target,source):void
Defined in: packages/app-logger/src/console-sink.ts:156
Patches the methods of a target Console object to use the methods of a
source Console object.
This can be used to redirect the output of the global console object to
an instance of ConsoleSink.
Example: const consoleSink = new ConsoleSink(logger); ConsoleSink.patchConsole(console, consoleSink);
Parameters
Section titled “Parameters”target
Section titled “target”Console
The target Console object to patch
source
Section titled “source”Console
The source Console object to use for the methods
Returns
Section titled “Returns”void