1.0.10 β€’ Published 6 months ago

logmojify v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

πŸš€ LogMojiFy - The Smart Emoji Logger πŸ”₯

npm version
License


🎯 Why LogMojiFy?

LogMojiFy is a lightweight yet powerful logging utility that automatically enhances console logs by overriding:
βœ… console.log
βœ… console.warn
βœ… console.error
βœ… console.debug

πŸ”Ή It assigns emoji-based categories for improved visibility and debugging.
πŸ”Ή It automatically detects log purposes (errors, security, transactions, API calls, etc.) and assigns relevant emojis for instant log identification.

πŸš€ No need to change your existing console.log statementsβ€”LogMojiFy does all the work for you!


πŸš€ How to Use LogMojiFy in Your Project

1️⃣ Global Import (Use LogMojiFy Throughout Your Project)

To enable logmojify globally (so it modifies console.log everywhere), import it in your main entry file.

Project TypeWhere to Import
Node.js (Backend)index.ts or server.ts
React (Vite / CRA)src/main.tsx or src/index.tsx
Next.jsapp/layout.tsx or pages/_app.tsx
Vue.jsmain.js or main.ts
Global Config Approachsrc/config.ts, then import in index.ts

βœ… Example:

// src/main.tsx (React) or index.ts (Node.js)
import "logmojify"; // Enables automatic log enhancements globally

πŸš€ After this, all console.log statements will be enhanced everywhere.


2️⃣ Import in a Specific File (Scoped Usage)

If you only need logmojify in certain files instead of globally, you can import and use it like this:

import logger from "logmojify";

logger.setCustomEmojis({ error: "πŸ”₯", warn: "⚠️" });

console.log("This is an info message"); // Enhanced with emojis
console.error("Something went wrong!"); // πŸ”₯ Something went wrong!

Note: If logmojify is imported globally (import "logmojify";), you don't need this manual import.


πŸ€– Automatic Log Categorization

LogMojiFy automatically detects the log type based on keywords in your logs.

Example Log MessageCategorized AsEmoji
"Database connection established!"DatabaseπŸ’Ύ
"Slow response detected"Performance⚑
"Unauthorized access attempt"SecurityπŸ”’
"Fetching API data"Network🌐
"User clicked the checkout button"User ActionπŸ–±οΈ
"Payment of $49.99 completed successfully"TransactionπŸ’°

βœ… No manual categorization neededβ€”LogMojiFy detects them for you!


🎨 Customizing Emojis

You can override default emojis using setCustomEmojis():

logger.setCustomEmojis({
  error: "πŸ”₯",
  warn: "⚠️",
  debug: "🐞",
  success: "πŸŽ‰",
});

Now, logs will use your custom emojis instead of the defaults.


πŸ“Œ Default Log Categories & Emojis

Log TypeEmojiDescription
info🟠General information logs (Now orange background)
warn⚠️Warnings that require attention
error❌Errors & failures
debugπŸ› οΈDebugging information
successβœ…Success messages
network🌐Network-related logs (API calls, requests)
dbπŸ’ΎDatabase operations
criticalπŸ”₯Critical issues requiring urgent action
securityπŸ”’Security-related events
performance⚑Performance optimizations & latency issues
analyticsπŸ“ŠTracking, metrics, and analytics events
eventπŸ“…Event-driven logs (tasks, jobs)
user-actionπŸ–±οΈUser interactions & UI events
systemπŸ–₯️System & process logs
auditπŸ“Compliance and audit logs
configπŸ”§Configuration changes
testingπŸš€Logs related to testing & debugging
ai🧠AI/ML-related logs
transactionπŸ’°Payment & transaction logs
fileπŸ“„File operations (upload/download)

πŸ›  How is LogMojiFy Different from Other Loggers?

Unlike Winston, Pino, or default console.log, LogMojiFy automatically categorizes logs and enhances console methods without extra setup.

FeatureLogMojiFyOther Loggers (e.g., Winston, Pino)
Automatic Console Overrideβœ… Yes❌ No (Requires explicit calls)
Automatic Log Categorizationβœ… Yes❌ No
Emoji-Based Loggingβœ… Yes❌ No
Color-Coded Outputβœ… Yesβœ… Yes
Customizable Emojisβœ… Yes❌ No
Works in Browser & Node.jsβœ… Yes❌ Most are Node-only

πŸš€ No need to refactor your codeβ€”LogMojiFy makes logs instantly better!


πŸ“œ How to Disable the Console Override

If you ever need to disable LogMojiFy and restore the default console methods:

console.log = console.constructor.prototype.log;
console.warn = console.constructor.prototype.warn;
console.error = console.constructor.prototype.error;
console.debug = console.constructor.prototype.debug;

πŸ—οΈ Contributing

Contributions are welcome! Follow these steps:

1️⃣ Fork the repository
2️⃣ Create a feature branch (feature/new-feature)
3️⃣ Commit your changes
4️⃣ Push to GitHub & create a PR


πŸ“ License

MIT License Β© 2025 sandunlasantha


πŸ”Ή Stay Updated!
πŸ“¦ View on npm
🌟 Star on GitHub


✨ Now, Enjoy LogMojiFy and Make Your Logs Fun & Readable! πŸŽ‰πŸš€

1.0.10

6 months ago

1.0.6

6 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.0

7 months ago