Angie Log
An extremely lightweight logging utility for NodeJS built in ES6
About
Angie Log is designed as an extremely lightweight logging utility for NodeJS which will:
- Prettify the terminal output using the Chalk package
- Provide utilities for printing useful and informative terminal output
- Create asynchronously written, non-blocking log files to maintain said useful and informative output based on well-defined JS log levels
Usage
npm i -g angie-log
If Used Standalone
import { default as Log } from 'angie-log';
let logger = new Log({
outfile: 'log.log',
file: 'log.log',
name: 'test',
timestamp: true,
level: 'debug',
levels: [ 'info', 'debug' ],
logLevel: 'debug',
logLevels: [ 'info', 'debug' ],
silent: false
}),
err = new Log('log.log', 'test', true, 'error', false);
logger.info('test');
err.error('test');
log.$setOutfile(`${process.cwd()}/angie.log`);
log.$setOutfile('test');
log.$setTimestamp(true);
log.$setLevel(true);
log.$setSilent(true);
Log.info('test');
Log.debug('test');
Log.warn('test');
Log.error('test');
If Used in an Angie Application
Include the module in the same fashion as it is above, or wherever called modules are bound:
@Controller
class Test {
constructor($Log) {
$Log.info('The log module was included in a controller');
}
}
The functions available on the Angie Log module are equivalent in either context.
For a list of Frequently Asked Questions, please see the FAQ and the CHANGELOG for an up to date list of changes. Contributors to this Project are outlined in the CONTRIBUTORS file.
Angie
Please see the site for information about the project, a quickstart guide, and documentation and the CHANGELOG for an up to date list of changes.