@micro-builder/package-practice
v2.0.0
Published
A package for practice
Downloads
38
Readme
Logger
A simple, colorful logging utility for Node.js applications.
Installation
npm install @micro-builder/package-practice
Usage
Import the Logger class:
import { Logger } from "@micro-builder/package-practice";
Basic Logging
Logger.logg("Hello, world!");
Logger.error("An error occurred");
Logger.info("Here's some information");
Logger.warn("This is a warning");
Logger.debug("Debugging information");
Logger.success("Operation successful");
Returning Colored Strings
const greenText = Logger.loggReturn("This text will be green");
const redText = Logger.errorReturn("This text will be red");
Logging JSON Objects
const user = { name: "John Doe", age: 30 };
Logger.loggJSON(user);
Logger.errorJSON(user);
Logger.infoJSON(user);
Logger.warnJSON(user);
Logger.debugJSON(user);
Logger.successJSON(user);
Multiple Arguments
typescript Logger.info("User", "John Doe", "logged in at", new Date());
Color Scheme
logg
andsuccess
: Greenerror
: Redinfo
: Bluewarn
: Yellowdebug
: Magenta
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.