@golfy/loggify
v1.0.0
Published
A standardized error logger
Maintainers
Readme
loggify 📦
A simple and standardized error logging library for Node.js (written in TypeScript)
Installation
npm install loggify chalkUsage
import { logError, initLogger } from "loggify";
initLogger({
level: "warn",
output: "file",
filePath: "./logs/app.log",
webhookUrl: "https://my-webhook.com/log",
compress: true
});
try {
throw new Error("Something went wrong!");
} catch (err) {
logError(err, { context: "login", userId: 42 }, "fatal");
}CLI Tool
node dist/cli.js ./logs/app.log
# or for compressed logs
node dist/cli.js ./logs/app.log.gzPrints a readable and colorized version of the log file.
License
MIT © Golfy
