colored-function-logger
v1.0.2
Published
A very light logger that automatically displays the calling function name with colors
Readme
Colored Function Logger
A very light logging utility that automatically displays the calling function name with unique colors for Node.js and browser with no dependencies.

Features
- Automatic calling function name detection
- Automatic color generation based on function name
- Work same as native console methods
- Environment detection (Node.js/Browser)
- All log levels (log, info, warn, error, debug)
- 0 dependencies
Installation
npm install colored-function-loggerUsage
There are two examples in the DEMO folder, one for Node.js and one for browser.
import logger from 'colored-function-logger';
function yourFunction() {
logger.log('This is a standard log');
logger.warn('But you can use the others log levels too!');
}Color Features Details
Browser: 16M colors, convert function name to hexadecimal color.
Node.js: 256 colors, convert function name to the closest ANSI color or fallback to 8 basic colors.
License
This project is licensed under CC BY-NC-SA.

