npm.io
3.0.4 • Published 4 years ago

@lightsource/log

Licence
GPL-2.0-only
Version
3.0.4
Deps
0
Size
23 kB
Vulns
0
Weekly
0

Log

What is it

Class for console logging with multiple levels

Installation

yarn add @lightsource/log

OR

npm install @lightsource/log

Example of usage

import Log from '@lightsource/log';

Log.setAppName('Rabbit');
Log.setIsDebugMode(true);
Log.setErrorCallback((level, message, debugArgs) => {
    // TODO
});

Log.write(Log.level.DEBUG, 'My color is a', {name: 'white'});

Example of output

Rabbit : DEBUG : My color is a : 17.3
Object { name: "white" }

Keywords