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

@msamblanet/node-slf

v0.1.2

Published

Logging adapter for node.js

Readme

Node SLF Logging Adapter

npm version License

This project provides a logging framework abstraction. The name is based off of slf4j. While similar libraries exist, none of them seem to have the logging frameworks I keep bumpping into and most do not support logging context objects.

Construct the LogAdapter of your choice and use it. If you need to change logging frameworks, you only need to change the adapter initialization and the rest of your code remains unchanged.

  • Notable Features:
    • Supports logging context data for the individual logs.
    • Supports child loggers, but assumes all names are : delimited.
    • Supports wrapping back into a console-like object for use by other libraries
  • Supported Frameworks:

Example Usage

// Example initializing with the console
import { ConsoleLogAdapter } from "@msamblanet/node-slf";
const log = new ConsoleLogAdapter();

// Example initializing with debug
import debug from "debug";
import { DebugLogAdapter } from "@msamblanet/node-slf";
const log = new DebugLogAdapter("name", debug);

// Example initializing with pino
import pino from "pino";
import { PinoLogAdapter } from "@msamblanet/node-slf";
const log = new PinoLogAdapter({ pino() });

// Example initializing with roarr
import { Roarr } from "roarr";
import { RoarrLogAdapter } from "@msamblanet/node-slf";
const log = new RoarrLogAdapter(Roarr);

// Example initializing with tslog
import { Logger } from "tslog";
import { TsLogAdapter } from "@msamblanet/node-slf";
const log = new TsLogAdapter({ log: new Logger() });

// Sample usage examples
import { BaseLogAdapter } from "@msamblanet/node-slf";

if (log.isLevelEnabled('silly')) log.silly();
if (log.isLevelEnabled(BaseLogAdapter.LOG_LEVEL_TRACE)) log.trace("Trace");
log.debug({ a: 42 });
log.info("Message %s %o", "Foo", { bar: 12 });
log.warn({ a: 42 }, "Message - %s", "FooBar");
log.error("Message");
log.fatal("...");

// This child logger will have :bar appended to the name
// Details of what this does vary by logger
const childLog = log.getChild("bar");

// Get a console-like object to use in another app
// Note that this is mostly but not 100% functional - some less common methods noop
const consoleLike = log.toConsole();

API

For now, see the source code

Other Notes

  • The core focus of this library is adaptability for normal business applications. It is not focused on performance although I've tried be reasonable. Suggestions on performance improvements are welcome but usabilty is a larger concern for this library.

@msamblanet/node-project-template

This project uses @msamblanet/node-project-template to provide boilerplate project content. See the documentation of that project for details on updating the templated components.