@silentias/unilogger
v1.0.0
Published
Simple and universal logger for Node.js and browser with colored output and optional timestamps.
Maintainers
Readme
Unilogger - simple and universal logger for Node.js and browser
Features
- Works both in Node.js and browsers
- Colored console logs (red, yellow, blue, gray)
- Optional timestamps
- Enable/disable logging via
LOG_ENABLEDenvironment variable (Node.js only) - Simple API:
error(),warn(),info(),print() - Default instance ready for quick use
Install
npm install @silentias/unilogger
or
download index.js file
Usage
import { log } from '@silentias/unilogger';
log.error("Error!");
log.warn("Warning");
log.info("Information");
log.print("Print");Creating your own instance with options
import { Log } from '@silentias/unilogger';
const myLog = new Log({ showTimestamp: false, enabled: true });
myLog.info("Without timestamp");Support
Supports ES2022 (ES13) and later
