kailogger
v1.0.8
Published
> The Ultimate Logger for Node.js — Beautiful, powerful, and designed for developers who care about aesthetics.
Readme
KaiLogger
The Ultimate Logger for Node.js — Beautiful, powerful, and designed for developers who care about aesthetics.
Turn your boring console logs into a cyber-aesthetic experience. KaiLogger is a complete CLI toolkit featuring a custom high-performance color engine (KaiChroma) with TrueColor support, gradients, and 14 built-in themes.
Features
| Category | Features | | --------------- | -------------------------------------------------------------- | | Logging | Log levels, scoped loggers, custom badges, silent mode | | Styling | 14 Themes, custom gradients, KaiChroma engine (TrueColor) | | Interactive | Spinners, progress bars, select menus, prompts | | Debug | Pretty errors, JSON highlighting, diff view, tree view | | Visuals | Charts (Bar, Sparkline, Gauge), Screenshots (TXT/HTML) | | System | Desktop Notifications, Encryption, Sound Alerts | | Transports | Console, File (with rotation), Webhooks |
Installation
npm install kailoggerQuick Start
import { kai } from "kailogger";
kai.success("Hello, beautiful world!");
kai.error("Something went wrong");
kai.warning("Careful there");
kai.info("Just FYI");
kai.debug("For your eyes only");
// Enable sound
kai.beep();Themes
Switch between 14 stunning themes powered by our custom KaiChroma engine.
kai.setTheme("cyberpunk");Available Themes:
zen(Minimalist)neon(Bright cyber)pastel(Soft colors)hacker(Matrix style)sunset(Warm gradients)ocean(Blue/Green tones)cyberpunk(Blue/Pink/Yellow)dracula(Dark mode favorite)monokai(Classic code style)vaporwave(Aesthetic purple/cyan)midnight(Deep blues)forest(Nature tones)volcano(Fiery reds/oranges)gold(Luxury)
Charts
Visualize data directly in your terminal.
Bar Chart
kai.chart([
{ label: "Users", value: 1500 },
{ label: "Sales", value: 890 },
{ label: "Errors", value: 32 },
]);Sparkline
kai.sparkline([10, 25, 40, 35, 60, 90, 45, 20]);
// Output: ▂▃▄▃▅▇▄▂Gauge
kai.gauge(75, 100, "CPU");
// CPU: [███████████████░░░░░] 75%Notifications & Sounds
Desktop Notifications Send native system notifications.
kai.notify("Build complete!", "Success");Sound Alerts Play sounds for events (Success, Error, Warning, Notification).
// Optional: Set custom sounds directory
kai.setSoundsDir("./src/sounds");
await kai.soundSuccess();
await kai.soundError();
kai.playSound("custom.wav");Encryption
Handle sensitive data securely.
// Mask sensitive info in logs
kai.masked("API Key", "sk-1234567890abcdef", 4);
// API Key: ************cdef
// Encrypt/Decrypt helpers
const secret = kai.encrypted("My Secret Data", "my-key");
kai.decrypted(secret, "my-key");Screen Capture
Capture terminal output to file.
kai.startCapture();
kai.success("This will be captured");
kai.info("So will this");
kai.saveScreenshot("logs/session.txt");
kai.saveScreenshotHtml("logs/session.html"); // Saves as styled HTML!Enterprise Features
Automatic PII Redaction Automatically mask sensitive data like Email, Credit Cards, and SSNs.
kai.configure({ redact: true });
kai.info("User email is [email protected]");
// Output: User email is [EMAIL_REDACTED]Trace ID Tracking Track requests across distributed systems.
import { KaiTrace } from "kailogger";
KaiTrace.run(() => {
kai.info("Processing Request"); // [a3f1b2...] Processing Request
someNestedFunction(); // [a3f1b2...] Nested Logic
});Party Mode
Celebrate your success with a confetti animation directly in your terminal!
// Celebrate for 3 seconds (default)
await kai.party();
// Celebrate for 5 seconds
await kai.party(5000);Log Levels & Scopes
// Set global level
kai.setLevel("warning");
// Scoped Logger
const db = kai.scope("Database");
db.info("Connected"); // [Database] ConnectedTree & Diff View
// Tree View
kai.tree({
src: { "index.ts": null, utils: { "helper.ts": null } },
});
// Diff View
kai.diff({ status: "idle" }, { status: "active" });Interactive Prompts
const name = await kai.ask("Name?");
const framework = await kai.select("Framework", ["React", "Vue", "Svelte"]);
// Progress Bar
const bar = kai.createProgress(100);
bar.update(50);Transports
kai.addFileTransport({
filename: "./logs/app.log",
maxSize: 10 * 1024 * 1024,
});
kai.addWebhookTransport({
url: "https://webhook.site/...",
});License
ISC
By Soblend Development Studio
