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

bitters

v3.0.0

Published

Multi transport logging for hive

Downloads

24

Readme

Bitters

A multi transport logging package for the hive platform. The logger can support any logger the implements the winston logging interface. Out of the box the logging package supports file transports for a log file that will get rotated every day, stdout which simply dumps all logs to the host computers stdout, and syslog which attempts to send logs to a running syslog server over udp.

Configuration

Logging options are set using the hive conf package so you can set you logging options as you would everything else. You use the --logger or -l the flag can be passed mutliple times to specify multiple transports. There is always an exception transport called stderr in the config that will always write to stdout For example, if you wanted to log to syslog, but also get feedback from stdout:

node server.js --logger=stdout --logger=syslog

trasport specific configuration can be specified using the log:<TRANSPORT> prefix. For example you can disable the json formatting by passing the prettyPrint option a falsy value.

node server --logger=stdout --log:stdout:prettyPrint=0
node server --log:stderr:prettyPrint=1

Available Transports

Name | Description | :------:|-----------| stdout | prints output to the current stdout | syslog | sends logs to a syslog server over UDP | file | Writes logs to a file that is rotated daily | papertrail | Sends logs to a configured papertrail server |

Logging

The logging package exports a fully configured winston interface that supports syslog logging levels. Each level is method on the interface that logs with the logging level, tag and logging level

var logger = require('bitters')
logger.http('hello world')
logger.debug('hello world')
logger.info('hello world')
logger.notice('hello world')
logger.warning('hello world')
logger.error('hello world')
logger.crit('hello world')
logger.alert('hello world')
logger.emerg('hello world')

Formatting

The loggers suppport the same formatting options and Node's util module.

var logger = require('bitters');

logger.debug('Hi, %s, my name is %', "Bill", variable)

The last argument to any of the log method can be a serialiable object and it will be included in the log data in an appropriate format.

var logger = require('bitters');

logger.debug("Dude, I just got some %s data", 'crazy', {key:'value'} )