A very light logging utility that automatically displays the calling function name with unique colors for Node.js and browser with no dependencies.
- 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
npm install colored-function-loggerThere 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!');
}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.
This project is licensed under CC BY-NC-SA.

