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

@liquicode/lib-logger

v0.2.2

Published

An easy and flexible logging system. Log to console, files, etc. Now with colors!

Downloads

23

Readme

lib-logger (v0.2.2)

An easy and flexible logging system. Log to console, files, etc. Now with colors!


Getting Started

Installation

Traditional installation for server-side platforms (nodejs/phantomjs)

npm install @liquicode/lib-logger

or: Traditional installation for client-side platforms (browser)

<bower install not yet supported>

or: Clone the source code

git clone https://github.com/agbowlin/lib-logger.git

or: Download the latest source code

https://github.com/agbowlin/lib-logger/archive/master.zip

Referencing the Library

const LIB_LOGGER = require( '@liquicode/lib-logger' );

From the library reference LIB_LOGGER, you can create specific loggers for different output devices or a generalized logger to render log messages on multiple devices.

Supported Platforms

lib-logger works with several platforms.

  • Browser
  • NodeJS
  • PhantomJS

Simple Usage

In NodeJS

// Reference the library.
const LIB_LOGGER = require( '@liquicode/lib-logger' );

// Call NewShellLogger() to get a logger object that prints message to the console.
let Logger = LIB_LOGGER.NewShellLogger( 'My Optional Log Group Name' );

// Log something
Logger.LogInfo( 'Hello, World!' );

In the Browser (client)

// Reference the library.
// (installed via 'bower install liqui-logger' ?)
const LIB_LOGGER = require('bower_components/liqui-logger/js/logger');

// Call NewConsoleLogger() to get a logger object that prints message to the console.
let Logger = LIB_LOGGER.NewConsoleLogger( 'My Optional Log Group Name' );

// Log something
Logger.LogInfo( 'Hello, World!' );
Logger.info( 'Hello, Again!' );

Sample Output

    group         date         time     ms   severity  message
      |            |            |       |       |         |
      v            v            v       v       v         v
==========================================
| Test Group | 2017-01-12 | 03:42:37 | 1547 | TRACE | This is a Trace message.
| Test Group | 2017-01-12 | 03:42:37 | 1548 | DEBUG | This is a Debug message.
| Test Group | 2017-01-12 | 03:42:37 | 1549 | INFO  | This is an Info message.
| Test Group | 2017-01-12 | 03:42:37 | 1551 | WARN  | This is a Warn message.
| Test Group | 2017-01-12 | 03:42:37 | 1552 | ERROR | This is an Error message.
==========================================
| Test Group | 2017-01-12 | 03:42:37 | 1559 | INFO  | Here is some extra data:
{
    "Field1": "Foo",             <--- extra data
    "Field2": "Bar"
}
==========================================      <--- separator line

ShellLogTarget colorized output


Links to More