The name of the logging subject.
Options to apply to instance.
Representation of a logging subject.
The name of the logging subject.
Options to apply to instance.
Child Logger instances.
The name of a logging subject that the instance represents.
The template to be used when parsing LoggerEntry.data for an LoggerEntry.message.
When a log message is not defined, the data associated with it can be used to create the message.
For example:
const logger = require('nomatic-logging');
logger.template = '{method} {url} ==> {status} {length} bytes';
logger.log('info', {
method: 'GET',
url: '/api/v1/users?page=1',
status: 200,
length: 1203
};
The LoggerEntry (sent on execute of each associated transport) would include a message
property set toGET /api/v1/users?page=1 ==> 200 1203 bytes.
When defining a template, variables from the log LoggerEntry's data object are used. The name of
the variable should be contained within curly braces, i.e. '{key}' would be replaced with value
if data has a property of key with value of value.
By default, a template is not used, so a message must be specified when calling log (or a method
associated with a log level). If template is defined, a message is optional, and template will
not be used if a message is defined.
Transport instances which are triggered in the log method (or a method associated with a log
level).
Return the log levels available and their associated priority.
Set the levels available for this instance. When levels are set, methods are created for new levels, while levels not specified on assignment are deleted.
Configure the instance at or after instantiation. All child instances will also be configured with the options specified.
Create a child Logger instance.
Find or create a child instance. If child instance has not already been created, options is inherited from
this instance.
Parse, validate, and pass a log entry to all associated transports.
Subscribe a callable function to a namespace.
Used to manage the subscription status via open and close methods.
Subscribe a callable function to a namespace, for exactly one execution.
Used to manage the subscription status via open and close methods.
Remove a Listener instance from the EventNamespace instance. Called with unsubscribe method.
A true value indicates a successful pop.
Add a Listener instance to the EventNamespace instance. Called with subscribe method.
Register a child instance.
: If false, child is already registered, else returns true.
Representation of a logging subject.