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

nhebo-logger

v1.0.29

Published

Nhebo logger library

Downloads

252

Readme

nhebo-logger

This package provides common logging utilities for Nhebo projects.

license: Copyright � Nhebo LLC - All Rights Reserved source: https://bitbucket.org/nhebo/library/src/master/nhebo-logger/ URL: https://www.npmjs.com/package/nhebo-logger chat: Nhebo Slack

Table of Contents


Installation

Install the package in any Nhebo project directly with:

npm install nhebo-logger

Usage

// Set config and logger
const config = { label: 'Nhebo-API' };
const logger = require('nhebo-logger')(config);

// Then use console.log as normal
console.emergency('system down. come to the office NOW!');
console.alert('sharks will attack soon. watch out.');
console.error('sharks are attacking. fix me.');
console.warning('sharks may attack. watch out.');
console.info('it was actually snakes on a plane.');
console.debug('line 32: shark was a snake.');

Note: in production, logs will be logged to the file system. In all other environments, logs will be sent to the console.

Warning levels

  • Emergency: critical system down. Wake me up at 3 am.
  • Alert: something may be wrong. Check within 24 hours.
  • Error: error message that something is wrong. Check within 24 hours.
  • Warning: warning message.
  • Info: informational message. Can be used for historical purposes.
  • Debug: debugging message. Used in local development for testing.

Logger configuration

The logger config object contains optional parameters for configuring your logger.

  • label: this is the label of the source. Defaults to Nhebo-Project
  • timestamp: this is the format that you want for the timestamps associated with every log. Defaults to YYYY-MM-DD HH:mm:ss
  • format: this is the format you want your logger to output in. Available options: logstash, file, console, json. Defaults to json
  • level: this is the log warning level you want to output. Defaults to info

Example

// First declare config
const config = { label: 'Nhebo-API', timestamp: 'YYYY-MM-DD HH:mm:ss' };

// Then use when you instantiate the logger
const logger = require('nhebo-logger')(config);

Tests

npm test

Publish

When you are ready to upload your fixes to npm, use the following to publish your package to the npm repository for nhebo. Please note that you must first login to npm via npm login for this command to work

npm publish

Contact

Team Nhebo Slack

License

Copyright (c) Nhebo LLC - All Rights Reserved.
Confidential, Proprietary and Trade Secrets Notice

Use of this software is governed by a license agreement. This software contains confidential, proprietary and trade secret information of Nhebo LLC and/or one of its subsidiaries and is protected under United States and international copyright and other intellectual property laws. Use, disclosure, reproduction, modification, distribution, or storage in a retrieval system in any form or by any means is prohibited without the prior express written permission of Nhebo LLC.