logger-alvamind v1.0.5
๐ logger-alvamind ๐
Your Colorful Companion for Node.js Logging!
Tired of boring, monochrome logs? logger-alvamind
is here to spice things up! ๐ This library provides a colorful, informative, and resource-aware logging experience for your Node.js applications. It's like giving your console a fresh coat of paint and a dashboard all in one! ๐จ๐
โจ Features & Benefits
- ๐ Colorful Logging:
- Each log level (info, warn, error, debug, verbose, resource) gets its own vibrant color scheme, making it easy to distinguish different messages at a glance.
- Uses ANSI escape codes, so it works on most modern terminals.
- โฑ๏ธ Timestamps:
- Every log message is automatically prefixed with a timestamp, so you know exactly when it happened.
- ๐๏ธ File Name Tracking:
- Logs include the file name where the log was called, making debugging a breeze.
- ๐ Real-Time Resource Usage:
- Display your application's current CPU and RAM usage directly in your console. No need for external tools!
- Resource usage is updated every second.
- Only updates when there is a change, preventing flickering on the console.
- โ๏ธ Message Rate Tracking:
- You can display the current message rate, for example, messages per second.
- ๐งน Clean Output:
- Clears the current line before logging the message, making the output clean and avoiding messy overlaps.
- ๐ ๏ธ Easy to Use:
- Simple API with methods for each log level, just like your standard
console.log
.
- Simple API with methods for each log level, just like your standard
- ๐ฆ Lightweight:
- Minimal dependencies to keep your project lean and fast.
- โจ๏ธ TypeScript Support:
- Written in TypeScript with full type definitions for a smooth development experience.
โ๏ธ Installation
Get started in a flash! โก๏ธ
npm install logger-alvamind
๐ Quick Start
Here's a simple example to get you logging like a pro! ๐
import { logger, setMesageRateString } from 'logger-alvamind';
logger.info('This is an info message.');
logger.warn('Watch out! Something might be fishy.');
logger.error('Houston, we have a problem!');
logger.debug('Debugging this logic...');
logger.verbose('More details, for the nerds!');
logger.resource('Resource usage info.');
setMesageRateString('120 messages/sec');
๐ API Reference
logger
Object
logger.info(message: string, ...args: any[]): void
- Logs an informational message in green shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.warn(message: string, ...args: any[]): void
- Logs a warning message in orange shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.error(message: string, ...args: any[]): void
- Logs an error message in red shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.debug(message: string, ...args: any[]): void
- Logs a debug message in light blue shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.verbose(message: string, ...args: any[]): void
- Logs a verbose message in light grey shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.resource(message: string, ...args: any[]): void
- Logs a resource message in dark green shades.
message
: The main log message string....args
: Optional additional arguments to log.
logger.clear(): void
- Clear the current line on the console.
setMesageRateString(messageRate: string): void
- Set the message rate string that will be displayed in resource usage info.
messageRate
: The message rate string.
๐ฃ๏ธ Roadmap
Here's what we have planned for the future:
โ Done
- Basic colorful logging with different levels.
- Timestamps in log messages.
- Tracking of the filename where the log is called.
- Display CPU and RAM usage in console.
- Clear current line before logging.
- Display custom message rate.
- Initial release as an npm package.
- Comprehensive documentation and examples.
โณ In Progress
- Implement log formatting options.
- Add configurable refresh rate for resource usage display.
- Explore adding log filtering based on levels.
๐ Future Goals
- Add support for log file output.
- Create a visual dashboard for resource tracking.
- Make colors and styles customizable through configuration.
- Add more log levels (e.g.,
fatal
). - Explore integrations with other logging tools.
๐ Contribution
Contributions are always welcome! ๐ If you have ideas for new features, improvements, or bug fixes, feel free to:
- Fork the repository.
- Create a new branch for your changes.
- Make your modifications and commit them with descriptive messages.
- Submit a pull request.
We appreciate your help in making logger-alvamind
even better! ๐ช
๐ฐ Donation
If you find this library useful and want to support its development, you can donate via:
- GitHub Sponsors: Link to GitHub Sponsors
- Buy us a coffee: Link to donation page
Any amount is greatly appreciated! ๐ Your support helps keep this project alive and thriving.
โ ๏ธ Disclaimer
This library is provided as is, without any warranty. We strive to keep it bug-free and useful, but we cannot guarantee that it will meet all of your specific needs. Use it at your own risk. By using this library, you agree to our terms of use.
๐ License
logger-alvamind
is licensed under the MIT License. Feel free to use, modify, and distribute it in your projects.
๐ค Stay Connected
We'd love to hear from you! Share your thoughts, ideas, and experiences using logger-alvamind
. Let's make logging awesome! ๐ค
Let's Get Logging! ๐