logcraft
v1.1.3
Published
Logcraft is a simple logging utility for Node.js applications. It provides three logging levels: `info`, `warn`, and `error`, each with colored output to improve readability in the terminal.
Readme
Logcraft
Logcraft is a simple logging utility for Node.js applications. It provides three logging levels: info, warn, and error, each with colored output to improve readability in the terminal.
Installation
npm i logcraftUsage
Importing the Logger
const logcraft = require('logcraft');Example
const logcraft = require('logcraft');
logcraft.info("This is an info message.");
logcraft.warn("This is a warning message.");
logcraft.error("This is an error message.");Output Format
Each log entry follows this format:
[YYYY-MM-DDTHH:MM:SS.sssZ][LEVEL] : messageExample Output:
[2025-03-21T12:00:00.000Z][INFO] : This is an info message.
[2025-03-21T12:00:01.000Z][WARN] : This is a warning message.
[2025-03-21T12:00:02.000Z][ERROR] : This is an error message.LogCraft automatically creates a new log file every day in the logs/ directory.
Example File Structure If today is March 24, 2025, LogCraft will create:
my-project/
│── logs/
│ ├── 2025-03-24.log ✅ (Today's log)
│ ├── 2025-03-23.log
│ ├── 2025-03-22.logLicense
This project is open-source and can be used freely.
