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 🙏

© 2024 – Pkg Stats / Ryan Hefner

levenlabs-log

v0.2.0

Published

Leven Labs Logging

Downloads

13

Readme

levenlabs-log

A library for logging that follows the Leven Labs Logging Spec. Based on go-llog.

Usage

var log = require('levenlabs-log');

Can also be used in a browser environment to log messages to the console.

Levels

  • 0 = Debug
  • 1 = Info
  • 2 = Warn
  • 3 = Error
  • 4 = Fatal

Methods

log.setLevel(level)

Set the global minimum logging level. level can be a string or number.

log.log(level, message, keyVals)

Log message if the current level is less or equal to level. level can be a string or number. If keyVals is sent, the values keys and values will be logged as well.

For convenience, if keyVals is an instance of Error it will be automatically expanded to {error: keyVals}.

log.debug(message, keyVals)

Helper method for calling log.log('debug', message, keyVals).

log.info(message, keyVals)

Helper method for calling log.log('info', message, keyVals).

log.warn(message, keyVals)

Helper method for calling log.log('warn', message, keyVals).

log.error(message, keyVals)

Helper method for calling log.log('error', message, keyVals).

log.fatal(message, keyVals)

Helper method for calling log.log('fatal', message, keyVals). Except that after it logs, it calls process.exit(1), if being called in a Node.js environment.

log.displayTimestamp

Defaults to false. Set to true to enable putting the timestamp in each log.