1.2.3 • Published 4 years ago

@hilgert/logger v1.2.3

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

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

1.2.3

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago