@livy/console-handler
v1.0.3
Published
Writes Livy log records to the terminal
Downloads
223
Maintainers
Readme
@livy/console-handler
This Livy handler writes log records to the terminal.
Synchronous logger support: yes
Runtime: Node.js and browsers (although in browsers, you probably want @livy/browser-console-handler
)
Basic Example
const { ConsoleHandler } = require('@livy/console-handler')
const handler = new ConsoleHandler()
Installation
Install it via npm:
npm install @livy/console-handler
Options
An object of options can be passed to the handler constructor as the first argument.
The following options are available:
bubble
Type: boolean
Default: true
Description: Controls whether records handled by this handler should bubble up to other handlers.
See also: Bubbling
console
Type: Console
Default: the global console
object
Description: The console object to use for logging
formatter
Type: FormatterInterface
Default: new ConsoleFormatter()
Description: The formatter to use.
level
Type: LogLevel
Default: 'debug'
Description: Controls which log records should be handled based on their log level.
Public API
bubble
Controls whether records handled by this handler should bubble up to other handlers. Initially set through the bubble
option.
See also: Bubbling
defaultFormatter
(read-only)
The formatter used by this handler if no formatter
option is set.
formatter
This handler supports formatters by implementing the FormattableHandlerInterface
.
level
The minimum log level of a log record to be considered by this handler. Initially set through the level
option.
processors
This handler supports processors by implementing the ProcessableHandlerInterface
.
reset()
This handler implements the ResettableInterface
. Resetting it resets all attached processors.
You usually don't want to call this method manually on an individual handler. Consider calling it on the logger instead.