colorful-log-levels
About
This is a really basic logging tool, still in development.
Why use this?
This is a very small and basic logging tool to give your logging some readability and tracability. Based on the native console.log node.js.
Getting Started
This project is available via NPM:
npm install --save colorful-log-levels
You should have Node 6.11
and tsc 2.1
or higher to be safely running this.
For TypeScript setup is simple:
import Logger from 'colorful-log-levels';
import { logLevels } from 'colorful-log-levels/enums';
let logger = new Logger('./logs', logLevels.error, true);
let test = `${6+1}`
logger.debug(`Test`);
logger.debug(test, 'Debug message');
logger.error('Very bad!!');
logger.error(Error('Oh no!!!!'), new Error('ALSO VERY BAD'));
For JS requires slightly different:
const Logger = require('colorful-log-levels').default;
let logLevels = require('colorful-log-levels/enums').logLevels;
let logger = new Logger('./logs', logLevels.error, true);
let test = `${6+1}`
logger.debug(`Test`);
logger.debug(test, 'Debug message');
Issues
Do you have any issues or recommendations for this package? Feel free to open an issue in the issue section. I'm always happy to help :D
License
This project is licensed under the MIT License - see the LICENSE.md file for details