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

fable-log

v3.0.17

Published

A simple logging wrapper.

Readme

Fable-Log

A flexible, extensible logging framework for Node.js and browser applications.

Build Status npm version License: MIT


Why Fable-Log?

Although there's no shortage of logging libraries, the effort to set up consistent, configurable logging across applications is not trivial. Want MongoDB logging in production and console logging for tests? Multiple output destinations? Browser compatibility? Fable-Log provides a simple, drop-in solution with a standard configuration interface.

Features

  • Multiple Log Streams - Route logs to console, files, or custom destinations simultaneously
  • Six Log Levels - trace, debug, info, warn, error, fatal
  • Browser Compatible - Works in both Node.js and browser environments
  • Extensible Providers - Create custom log providers for any destination
  • Time Tracking - Built-in methods for timing and profiling operations
  • Datum Decoration - Transform log data before output
  • Zero Configuration - Works out of the box with sensible defaults

Installation

npm install fable-log

Quick Start

const FableLog = require('fable-log');

const log = new FableLog();
log.initialize();

// Log at any level
log.trace('Detailed trace information');
log.debug('Debug information');
log.info('Informational message');
log.warn('Warning message');
log.error('Error occurred');
log.fatal('Fatal error');

// Include data objects
log.info('User logged in', { userId: 123, ip: '192.168.1.1' });

Configuration

Pass a settings object to customize behavior:

const log = new FableLog({
    Product: 'MyApplication',
    ProductVersion: '1.0.0',
    LogStreams: [
        {
            loggertype: 'console',
            level: 'debug',
            showtimestamps: true,
            formattedtimestamps: true
        },
        {
            loggertype: 'simpleflatfile',
            level: 'info',
            path: './logs/application.log'
        }
    ]
});

log.initialize();

Log Levels

| Level | Description | |-------|-------------| | trace | Detailed debugging information | | debug | Debug information | | info | General informational messages | | warn | Warning conditions | | error | Error conditions | | fatal | Critical/fatal errors |

Built-in Providers

Console Provider

{
    loggertype: 'console',
    level: 'trace',
    showtimestamps: true,
    formattedtimestamps: true,
    Context: 'MyApp'
}

Simple Flat File Provider

{
    loggertype: 'simpleflatfile',
    level: 'info',
    path: './logs/app.log'
}

Time Tracking

Built-in methods for measuring operation durations:

const startTime = log.getTimeStamp();

// ... perform operation ...

log.logTimeDeltaRelative(startTime, 'Operation complete');
// Output: "Operation complete logged at (epoch 1705315800000) took (1523ms)"

log.logTimeDeltaRelativeHuman(startTime, 'Long operation');
// Output: "Long operation ... took (125000ms) or (00:02:05.000)"

Browser Usage

Fable-Log works in browser environments with automatic provider adaptation:

// With bundler (webpack, rollup, etc.)
import FableLog from 'fable-log';

const log = new FableLog();
log.initialize();
log.info('Hello from the browser!');

Custom Providers

Create custom providers by extending the base logger:

const BaseLogger = require('fable-log').LogProviderBase;

class MyCustomProvider extends BaseLogger {
    write(pLevel, pLogText, pObject) {
        // Your implementation
    }
}

// Register and use
log._Providers.mycustom = MyCustomProvider;

Documentation

Full documentation is available in the docs folder:

Viewing Documentation Locally

Serve the docs folder with any static server:

npx docsify-cli serve docs

Then open http://localhost:3000 in your browser.

Part of the Fable Ecosystem

Fable-Log is designed to work seamlessly with other Fable packages:

Testing

Run the test suite:

npm test

Run with coverage:

npm run coverage

Related Packages

License

MIT

Contributing

Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the Retold Contributing Guide.