logger-logs v1.0.2
π logger-logs | Lightweight Logger for JavaScript & Node.js
π logger-logs is a powerful yet lightweight logging utility for JavaScript and Node.js. It helps developers debug applications efficiently by logging messages with the file path, line number, and formatted content.
πΉ Perfect for debugging & error tracking
πΉ Supports structured logging (JSON, objects, arrays, etc.)
πΉ Zero configurationβjust import and log
π Features
β
File Path & Line Number β Find exactly where logs originate.
β
Supports Objects & Arrays β Structured, easy-to-read logs.
β
Error-Safe β Prevents logging issues from breaking your app.
β
Minimal Overhead β Keeps performance optimized.
β
Simple API β Just call logger(...)
.
π¦ Installation
Install via npm:
npm install logger-logs
Or add it manually to your package.json
:
"dependencies": {
"logger-logs": "^1.0.1"
}
β‘ Usage
πΉ Basic Logging
import { logger } from "logger-logs";
logger("Hello, world!");
π Output:
Path:: /path/to/file.js, Line:: 5, Message:: Hello, world!
πΉ Logging Objects & JSON
logger({ user: "JohnDoe", role: "admin" });
π Output:
Path:: /path/to/file.js, Line:: 6, Message:: {
"user": "JohnDoe",
"role": "admin"
}
πΉ Logging Multiple Arguments
logger("User details:", { id: 123, name: "Alice" });
π Output:
Path:: /path/to/file.js, Line:: 7, Message:: User details: {
"id": 123,
"name": "Alice"
}
π Advanced Usage
πΉ Customizing Log Output
The logger automatically captures file path and line numbers, but you can extend its behavior using wrappers.
Example:
function debugLogger(message) {
logger(`[DEBUG] ${message}`);
}
debugLogger("API response received");
π οΈ Why Choose logger-logs
?
βοΈ Beginner-Friendly β No setup required.
βοΈ Optimized for Debugging β Track errors easily.
βοΈ Minimal & Lightweight β No unnecessary dependencies.
βοΈ Works in JavaScript & TypeScript β Node.js & Browser support.
π Documentation
For full documentation, visit:
π GitHub Repo β logger-logs
π‘ Contributing
Want to improve this package? Feel free to fork the repo, make your changes, and submit a pull request.
π© Support
πΉ Found a bug? Report it here: Issues
πΉ Need help? Reach out via Email
π License
This package is open-source under the ISC License.
π Install logger-logs
now and simplify debugging in your JavaScript & Node.js apps! π