Constructs a new Logger.
A set of LoggerOptions or name to use with the default options.
The default LoggerLevel when constructing new Logger instances.
A list of all lower case LoggerLevel names.
The name of the root sfdx Logger.
Add a field to all log lines for this logger.
The name of the field to add.
The value of the field to be logged.
For convenience this object is returned.
Adds a filter to be applied to all logged messages.
A function with signature (...args: any[]) => any[] that transforms log message arguments.
Adds a file stream to this logger.
The path to the log file. If it doesn't exist it will be created.
Resolved or rejected upon completion of the addition.
Adds a stream.
The stream configuration to add.
Close the logger, including any streams, and remove all listeners.
Logs at debug level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Logs at error level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Logs at fatal level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Gets an array of log line objects. Each element is an object that corresponds to a log line.
Gets the underlying Bunyan logger.
The low-level Bunyan logger.
Gets the current level of this logger.
Gets the name of this logger.
Logs at info level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Reads a text blob of all the log lines contained in memory or the log file.
Set the logging level of all streams for this logger. If a specific level is not provided, this method will
attempt to read it from the environment variable SFDX_LOG_LEVEL, and if not found,
{@link Logger.DEFAULT_LOG_LEVEL} will be used instead.
For convenience this object is returned.
Compares the requested log level with the current log level. Returns true if the requested log level is greater than or equal to the current log level.
The requested log level to compare against the currently set log level.
Logs at trace level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Use in-memory logging for this logger instance instead of any parent streams. Useful for testing.
WARNING: This cannot be undone for this logger instance.
For convenience this object is returned.
Logs at warn level with filtering applied.
Any number of arguments to be logged.
For convenience this object is returned.
Gets a numeric LoggerLevel value by string name.
The level name to convert to a LoggerLevel enum value.
Gets the root logger with the default level and file stream.
A logging abstraction powered by Bunyan that provides both a default logger configuration that will log to
sfdx.log, and a way to create custom loggers based on the same foundation.// Gets the root sfdx logger const logger = await Logger.root();
// Creates a child logger of the root sfdx logger with custom fields applied const childLogger = await Logger.child('myRootChild', {tag: 'value'});
// Creates a custom logger unaffiliated with the root logger const myCustomLogger = new Logger('myCustomLogger');
// Creates a child of a custom logger unaffiliated with the root logger with custom fields applied const myCustomChildLogger = myCustomLogger.child('myCustomChild', {tag: 'value'});
https://github.com/cwallsfdc/node-bunyan
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_log_messages.htm