1.0.2 β€’ Published 4 months ago

logger-logs v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

πŸ“œ logger-logs | Lightweight Logger for JavaScript & Node.js

NPM Version
Downloads
License
GitHub Repo

πŸš€ 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! πŸš€