1.2.3 • Published 6 years ago
@hilgert/logger v1.2.3
HLogger
A simple Logger for Node JS with colors, logging levels and writing to file
Examples
const HLogger = require('@h/logger');
// ...
const logger = new HLogger('TEST', true); // MAIN - Logger TAG
// true - Write to file
logger.log('Hello', 'World'); // [18:17:56][TEST] Hello World
logger.error('My Error', new Error('...')); // [18:17:56][TEST/E] My Error (StackTrace) (Red)
logger.warn('Warning'); // [18:17:56][TEST/W] Warning (Yellow)
logger.debug('My Debug message'); // [18:17:56][TEST/D] My Debug message
logger.log(logger.green, 'Green text', logger.blue, 'Blue text'); // Prints the colored textSupported colors
black, red, green, yellow, blue, magenta, cyan, white
Special codes
reset, bright, dim, underscore, blink, reverse, hidden