The logging config, at its core, is just a list of events to enable/disable, and where to emit/log them.
When they're inherited by child classes, it's done as a simple list merge, with the child's config taking precedence.
(e.g. [...parentConfig, ...childConfig]). Each new layer of config is applied on top of the previous one, overwriting
any previous settings for the same events.
Overview
The configuration for logging events emitted by the DataAPIClient.
This can be set at any level of the major class hierarchy, and will be inherited by all child classes.
Configuration inheritance
The logging config, at its core, is just a list of events to enable/disable, and where to emit/log them.
When they're inherited by child classes, it's done as a simple list merge, with the child's config taking precedence. (e.g.
[...parentConfig, ...childConfig]
). Each new layer of config is applied on top of the previous one, overwriting any previous settings for the same events.Configuration & shorthands
There's multiple ways to configure logging, depending on how much control you want:
logging: 'all'
'all'
, it simply replaces it with EventLoggingDefaultslogging: [{ events: 'all', emits: 'event' }]
logging: '<command>' | ['<commands>']
logging: ['all', [{ events: ['<commands>'], emits: [] }]]
Just keep in mind that it's really just a list of configuration "layers".
Event types
See DataAPIClientEventMap for more information on the types of events emitted.
Output types
The
emits
field can be set to either 'event', 'stdout', or 'stderr'.Examples