Represents the different events that can be emitted/logged by the DataAPIClient, or any of its children classes.
Additionally, you may use regular expressions or 'all' to match multiple events at once.
'all'
See DataAPIClientEventMap & LoggingConfig for much more info.
Regular expressions are a way to match multiple events at once. For example:
const client = new DataAPIClient({ logging: [{ events: `/.*(Started|Succeeded)/`, emits: 'stderr:verbose' }],}); Copy
const client = new DataAPIClient({ logging: [{ events: `/.*(Started|Succeeded)/`, emits: 'stderr:verbose' }],});
is equivalent to:
const client = new DataAPIClient({ logging: [{ events: [ 'commandStarted', 'commandSucceeded' , 'adminCommandStarted', 'adminCommandSucceeded' ], emits: 'stderr:verbose', }],}); Copy
const client = new DataAPIClient({ logging: [{ events: [ 'commandStarted', 'commandSucceeded' , 'adminCommandStarted', 'adminCommandSucceeded' ], emits: 'stderr:verbose', }],});
'all' is simply a more semantic alternative to using the regex /.*/ to match all events. There is no functional difference between the two.
/.*/
You may use it to enable all events at once with sane defaults:
logging: 'all' Copy
logging: 'all'
Or to specify the output for all events at once:
logging: [{ events: 'all', emits: 'stderr:verbose' }] Copy
logging: [{ events: 'all', emits: 'stderr:verbose' }]
Or even as a base config to override with specific rules later:
logging: ['all', { events: ['commandStarted', 'commandSucceeded'], emits: [] }] Copy
logging: ['all', { events: ['commandStarted', 'commandSucceeded'], emits: [] }]
Overview
Represents the different events that can be emitted/logged by the DataAPIClient, or any of its children classes.
Additionally, you may use regular expressions or
'all'
to match multiple events at once.See DataAPIClientEventMap & LoggingConfig for much more info.
Regex matching
Regular expressions are a way to match multiple events at once. For example:
is equivalent to:
Using
'all'
'all'
is simply a more semantic alternative to using the regex/.*/
to match all events. There is no functional difference between the two.You may use it to enable all events at once with sane defaults:
Or to specify the output for all events at once:
Or even as a base config to override with specific rules later: