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

pretty-pino-logger

v2.0.2

Published

A colorized logger utility similar to pino-pretty with support for multiple log levels, timestamps, and formatted output.

Readme

🪵 Logger System

A beautiful, feature-rich logging system for TypeScript/JavaScript applications with colorized output, emoji icons, and flexible configuration options.

✨ Features

  • 🎨 Colorized Output - Beautiful ANSI color codes for different log levels
  • 🎯 Emoji Icons - Visual indicators for each log level
  • Timestamps - ISO 8601 formatted timestamps (configurable)
  • 📊 Multiple Log Levels - Trace, Debug, Info, Success, Warn, Error, and Fatal
  • 🔧 Flexible Configuration - Customize timestamp and colorization per log call
  • 🚀 Zero Dependencies - Lightweight and fast
  • 📦 TypeScript Support - Full type safety included

📦 Installation

npm install your-logger-package
# or
yarn add your-logger-package

🚀 Quick Start

import logger from './index';

// Simple logging
logger.info('Application started');
logger.success('Database connection established');
logger.warn('This is a warning');
logger.error('Something went wrong');

// With additional arguments
logger.debug('User data:', { id: 123, name: 'John' });
logger.error('Failed to connect:', error);

📚 API Reference

Log Levels

The logger supports seven log levels, each with its own color and emoji:

| Level | Emoji | Color | Use Case | |-------|-------|-------|----------| | trace | 🔍 | Gray | Very detailed tracing information | | debug | 🐛 | Cyan | Debug information for development | | info | ℹ️ | Green | General informational messages | | success | ✅ | Bright Green | Success messages and completed operations | | warn | ⚠️ | Yellow | Warning messages | | error | ❌ | Red | Error messages | | fatal | 💀 | Magenta | Critical errors that may cause termination |

Methods

logger.trace(message: string, ...args: any[]): void

Logs a trace-level message.

logger.trace('Entering function');

logger.debug(message: string, ...args: any[]): void

Logs a debug-level message.

logger.debug('Variable value:', variable);

logger.info(message: string, ...args: any[]): void

Logs an info-level message.

logger.info('Server listening on port 3000');

logger.success(message: string, ...args: any[]): void

Logs a success-level message. Perfect for indicating successful operations, completed tasks, or positive outcomes.

logger.success('User registration completed');
logger.success('Payment processed successfully', { transactionId: '12345' });

logger.warn(message: string, ...args: any[]): void

Logs a warning-level message.

logger.warn('Deprecated API used');

logger.error(message: string, ...args: any[]): void

Logs an error-level message.

logger.error('Failed to process request:', error);

logger.fatal(message: string, ...args: any[]): void

Logs a fatal-level message.

logger.fatal('Critical system failure');

logger.log(level: LogLevel, message: string, ...args: any[]): void

Generic log method that accepts a log level as the first parameter.

logger.log('info', 'Custom log level');

🎨 Output Format

The logger formats messages as follows:

[2024-01-15T10:30:45.123Z] ℹ️  INFO  Your message here

Format breakdown:

  • [timestamp] - ISO 8601 formatted timestamp (optional)
  • emoji - Visual indicator for the log level
  • LEVEL - Uppercase log level name (padded to 5 characters)
  • message - Your log message
  • Color coding applied based on log level

💡 Examples

Basic Usage

import logger from './index';

// Different log levels
logger.trace('Detailed trace information');
logger.debug('Debugging information');
logger.info('Application started successfully');
logger.success('User logged in successfully');
logger.warn('This feature is deprecated');
logger.error('An error occurred');
logger.fatal('Critical failure');

With Additional Data

// Logging objects and arrays
logger.debug('User object:', { id: 1, name: 'Alice' });
logger.info('Processing items:', [1, 2, 3, 4, 5]);

// Logging errors
try {
    // some code
} catch (error) {
    logger.error('Exception caught:', error);
}

Dynamic Logging

const level = 'info';
logger.log(level, 'Dynamic log level');

🔧 Configuration

The logger uses sensible defaults but supports configuration through the LogOptions interface:

interface LogOptions {
    level?: LogLevel;
    timestamp?: boolean;  // Default: true
    colorize?: boolean;   // Default: true
}

Note: Currently, the logger applies default formatting to all messages. Future versions may support per-message configuration.

🎯 Use Cases

  • Development - Use trace and debug for detailed development logs
  • Production - Use info, warn, and error for production logging
  • Monitoring - Use fatal for critical issues that require immediate attention
  • Debugging - Use debug to track variable values and execution flow

🌟 Best Practices

  1. Use appropriate log levels - Don't use error for warnings or info for debug messages
  2. Include context - Add relevant data to help diagnose issues
  3. Avoid logging sensitive data - Never log passwords, tokens, or personal information
  4. Use structured logging - Pass objects as additional arguments for better parsing
  5. Set log levels per environment - Consider filtering logs based on environment

📝 Example Output

[2024-01-15T10:30:45.123Z] 🔍 TRACE Entering authentication function
[2024-01-15T10:30:45.124Z] 🐛 DEBUG User ID: 12345
[2024-01-15T10:30:45.125Z] ℹ️  INFO  Processing authentication request
[2024-01-15T10:30:45.126Z] ✅ SUCCESS User authenticated successfully
[2024-01-15T10:30:45.127Z] ⚠️  WARN  Using deprecated authentication method
[2024-01-15T10:30:45.128Z] ❌ ERROR Failed to connect to database
[2024-01-15T10:30:45.129Z] 💀 FATAL Critical system failure detected

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

[Your License Here]

🙏 Acknowledgments

Built with ❤️ for the developer community.


Made with care | Simple, beautiful, and effective logging for your applications