@qui-cli Plugin: Standardized winston wrapper
npm install @qui-cli/log@qui-cli Plugin: Standardized winston wrapper


``sh`
npm install @qui-cli/log @qui-cli/core
`ts
import { Log } from '@qui-cli/log';
import { Core } from '@qui-cli/core';
// process user-provided command-line arguments
const args = Core.init();
// use Log
Log.debug(args);
`
`ts`
export type Configuration = Plugin.Configuration & {
logFilePath?: string;
stdoutLevel?: string;
fileLevel?: string;
levels?: CustomLevels;
root?: string;
};
Optional path to log file (relative to root).
Log level to display via stdout/console, defaults to 'info';
Log level to write to log file (if logFilePath defined), defaults to 'all';
Custom log levels to use, specified by Log.CustomLevels
Optional root to use as the base for relative logFilePath. If undefined, falls back to the path defined by @qui-cli/root.
Exposes logFilePath, stdoutLevel, and fileLevel to user-provided command line arguments.
Log will updating logging settings after user-provided command line arguments are parsed. If stdoutLevel is set to off, logging to the console will be disabled. If configure() has provided a logFilePath value previously and the user provides an additional logFilePath, logs will be written to both paths.
`ts`
import { Log } from '@qui-cli/log';
Get the actual winston logger object.
Directly invoke the winston log()` method
Log a string or object (to be stringified -- in color in the console) at the respective log level.