@digitalronin/logger
v1.0.3
Published
Console logger for node and browser environment
Downloads
9
Maintainers
Readme
@digitalronin/logger
A simple wrapper for console.log
for Node or browser. The former supports colors, using chalk
Link
Installation
# Using Yarn
> yarn add @digitalronin/logger --dev
# Using NPM
> npm install @digitalronin/logger -D
Usage
Browser
const Logger = require('@digitalronin/logger');
const l = new Logger();
// console.log
l.log('Test log');
// console.error
l.error('Test error');
// console.log
l.info('Test info');
Node
const Logger = require('@digitalronin/logger');
const l = new Logger();
// console.log in white
l.log('Test log');
// console.log in red
l.error('Test error');
// console.log in blue
l.info('Test info');
Overwriting default colors
Only the following colors is supported
const Logger = require('@digitalronin/logger');
const l = new Logger({
error: 'blue',
info: 'white',
log: 'green',
});