@hilgert/logger
v1.2.3
Published
```js const HLogger = require('@h/logger');
Downloads
5
Readme
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 text
Supported colors
black
, red
, green
, yellow
, blue
, magenta
, cyan
, white
Special codes
reset
, bright
, dim
, underscore
, blink
, reverse
, hidden