npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ernest-logger

v2.0.4

Published

Dead-simple, colorful, emoji-powered logger with zero dependencies. Now with instant-use defaults and enhanced colors!

Downloads

121

Readme

Ernest-Logger v2.0 ⚡️🚀✨

Logging doesn't have to be boring.
The world's simplest, most beautiful logger just got even better.

NEW in v2.0: Import and use instantly. No configuration needed. Smart defaults built-in.

const logger = require('ernest-logger');

logger.info("Hello world! 👋");
logger.success("It just works! ✅");
logger.error("Uh oh! ❌");

That's it. Zero config. Zero dependencies. 100% vibes.


🆕 What's New in v2.0.0

🎯 Instant Use — Import and start logging immediately with smart defaults
🎨 Enhanced Colors — 16-color palette + bright variants + backgrounds
More Emojis — 100+ emojis organized by category
📊 New Methodstable(), json(), group(), timing utilities
Better Performance — Optimized file rotation and formatting
🔧 Formatter Utils — Progress bars, badges, boxes, and more
📘 Full TypeScript — Complete type definitions with autocomplete


🔥 Why Ernest-Logger v2?

| Feature | Ernest v2 | Winston | Pino | Bunyan | |---------|-----------|---------|------|--------| | Zero Config | ✅ | ❌ | ❌ | ❌ | | Zero Dependencies | ✅ | ❌ | ❌ | ❌ | | Instant Use | ✅ | ❌ | ❌ | ❌ | | Beautiful Output | ✅ | ⚠️ | ❌ | ❌ | | Emoji Support | ✅ | ❌ | ❌ | ❌ | | File Logging | ✅ | ✅ | ✅ | ✅ | | TypeScript | ✅ | ✅ | ✅ | ✅ | | Fun Factor | 💯 | 😐 | 😐 | 😐 |


📦 Installation

npm install ernest-logger

🚀 Quick Start

Instant Use (No Config Required)

const logger = require('ernest-logger');

// Basic logging with smart defaults
logger.info("Server starting...");
logger.success("Connected to database ✅");
logger.warn("Memory usage high ⚠️");
logger.error("Failed to load config ❌");
logger.debug("Request payload: {...}");

// Specialized logs
logger.start("Application started");
logger.network("API call to /users");
logger.db("Query executed in 23ms");
logger.security("Invalid token detected");

Custom Configuration (Optional)

const { createLogger } = require('ernest-logger');

const logger = createLogger({
  time: true,           // Show timestamps (default: true)
  emoji: true,          // Show emojis (default: true)
  level: 'info',        // Minimum level (default: 'debug')
  file: true,           // Save to file (default: false)
  filePath: './app.log', // Custom path
  prefix: '[APP]',      // Custom prefix
  customLevels: {
    deploy: { color: 'brightCyan', emoji: '🚀', priority: 3 }
  }
});

logger.deploy("Deploying to production...");

🎯 Log Levels

Ernest Logger has 7 core levels, from most to least verbose:

  1. trace 🔍 — Detailed debugging info
  2. debug 🐞 — Debug information
  3. info ℹ️ — General information
  4. success ✅ — Success messages
  5. warn ⚠️ — Warning messages
  6. error ❌ — Error messages
  7. fatal 💀 — Critical failures

Level Filtering

const logger = createLogger({ level: 'warn' });

logger.debug("This won't show");
logger.info("This won't show either");
logger.warn("This will show ⚠️");
logger.error("This will show ❌");

🎨 Enhanced Colors

v2.0 includes 40+ color options:

Standard Colors

red, green, yellow, blue, magenta, cyan, white, black

Bright Colors

brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite

Background Colors

bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite

Usage with Nested Logger

logger.log.info.blue("Blue information");
logger.log.success.brightGreen("Bright green success!");
logger.log.error.brightRed("Critical error!");
logger.log.warn.brightYellow("Warning message");

💥 Advanced Features

Big Announcements

logger.bigLog("🚀 DEPLOYMENT COMPLETE 🚀", {
  color: 'green',
  emoji: '🎉'
});

Tables

const users = [
  { id: 1, name: 'Alice', role: 'Admin' },
  { id: 2, name: 'Bob', role: 'User' }
];

logger.table(users);

JSON Pretty Print

const config = { host: 'localhost', port: 3000 };
logger.json(config, 'Server Config');

Grouping

logger.group('User Registration');
logger.info("Validating email...");
logger.info("Checking password strength...");
logger.success("User created!");
logger.groupEnd();

Timing

logger.time('database-query');
// ... some operation ...
logger.timeEnd('database-query'); // Outputs: database-query: 234ms

🎭 100+ Emojis

Organized by category for easy discovery:

System: start, stop, restart, boot, shutdown
Network: network, api, upload, download, webhook
Database: db, cache, query, backup, migration
Security: security, auth, encrypt, firewall, token
Development: test, build, deploy, bugFix, feature
Status: online, offline, pending, loading, complete

And many more! Check emojis/emojis.js for the full list.


🔧 Dynamic Configuration

const logger = require('ernest-logger');

// Toggle features on the fly
logger.disableEmoji();
logger.enableFile();
logger.setLevel('warn');

// Or chain them
logger.disableTime().enableFile().setLevel('error');

// Update config
logger.configure({
  prefix: '[PROD]',
  file: true,
  level: 'info'
});

📁 File Logging

const logger = createLogger({
  file: true,
  filePath: './logs/app.log',
  maxFileSize: 5 * 1024 * 1024 // 5MB (auto-rotation)
});

logger.info("This goes to console AND file");

Features:

  • Automatic file rotation when size limit reached
  • ANSI codes stripped from file output
  • Timestamped backup files

🧩 Custom Log Levels

const logger = createLogger({
  customLevels: {
    deploy: { 
      color: 'brightCyan', 
      emoji: '🚀',
      priority: 3  // Between info (2) and warn (4)
    },
    audit: { 
      color: 'brightMagenta', 
      emoji: '📋',
      priority: 2
    },
    celebrate: { 
      color: 'rainbow', 
      emoji: '🎉',
      priority: 3
    }
  }
});

logger.deploy("Pushing to production...");
logger.audit("User action recorded");
logger.celebrate("1 million users! 🎊");

🌍 Global Configuration

Set defaults for all logger instances:

const { setGlobalConfig } = require('ernest-logger');

setGlobalConfig({
  time: false,
  emoji: true,
  level: 'info',
  prefix: '[MyApp]'
});

// All new loggers will inherit these defaults
const logger1 = require('ernest-logger');
const logger2 = createLogger(); // Both use global config

🎓 Examples

Express.js Middleware

const logger = require('ernest-logger');

app.use((req, res, next) => {
  logger.network(`${req.method} ${req.url}`);
  next();
});

Error Handling

try {
  // some operation
} catch (error) {
  logger.error(`Operation failed: ${error.message}`);
  logger.debug(error.stack);
}

Startup Messages

logger.bigLog('🚀 SERVER STARTING 🚀', { color: 'blue' });
logger.info(`Environment: ${process.env.NODE_ENV}`);
logger.info(`Port: ${PORT}`);
logger.db('Connected to MongoDB');
logger.cache('Redis connected');
logger.success('✅ Server ready!');

📊 Performance

Ernest Logger v2 is optimized for both development and production:

  • Zero dependencies = No bloat, faster installs
  • Lazy formatting = Only formats visible log levels
  • Efficient file I/O = Buffered writes with rotation
  • Minimal overhead = <1ms per log call

🤝 Community & Support

Join the Ernest Tech House family:


🚫 Contribution Policy

Bug Reports: Always welcome via GitHub Issues

Feature Ideas: DM Ernest directly (see links above)

Pull Requests: Only accepting PRs for:

  • Critical bug fixes
  • Performance improvements
  • Security patches

This keeps Ernest-Logger lean, consistent, and fun while still valuing community input.


📜 Migration from v1.x

v2.0 is 99% backward compatible. Key changes:

  1. Default export is now a ready-to-use logger instance
  2. Use createLogger() for custom configs (previously default export)
  3. New color names (e.g., brightRed instead of just red for bright variants)
  4. bigLog() signature changed: bigLog(message, options) instead of bigLog(level, color, message)

v1.x Code

const createLogger = require('ernest-logger');
const logger = createLogger();
logger.log.info.blue("Hello");

v2.0 Code (Better!)

const logger = require('ernest-logger');
logger.info("Hello");

💡 Philosophy

Ernest-Logger isn't just a logger — it's a statement:

✨ Clean code can be colorful
🎨 Developer experience matters
🚀 Simple beats complex
💚 Zero dependencies is beautiful
🎉 Logging should be fun


📄 License

MIT © Ernest Tech House


⭐ Star Us!

If Ernest-Logger makes your dev life better, give us a star on GitHub!

Made with 💚 by developers who believe logging should be beautiful.