@virtuous/logger
v1.0.0
Published
A logging engine for JavaScript applications.
Downloads
230
Readme
@virtuous/logger
Logger is a simple but effective logging engine for JavaScript applications.
Installation
npm install --save @virtuous/logger
Usage
The main logger
ES2017 (prefered)
import { logger } from '@virtuous/logger';
logger.log(/* custom log message */);
logger.warn(/* custom warning message */);
logger.error(/* custom error message */);
CommonJS (e.g. for usage in Node.js applications)
const logger = require('@virtuous/logger').logger;
logger.log(/* custom log message */);
logger.warn(/* custom warning message */);
logger.error(/* custom error message */);
The grouped log
Other than the main logger, this function can't be used in an Node.js environment. It is only meant to be used in a browser.
import { group } from '@virtuous/logger';
group(/* message, content, actionColor */);