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

logeek

v2.0.6

Published

A better way to Javascript logging

Downloads

32

Readme

logeek

A log framework for geeks! Logeek adds control and joy to your console log messages. It's a high performance, light weight tool for logging Javascript messages in node or browser. It can be combined with other tools such as Chalk to extend it's powers even more.

Builder package.json size Victory size Travis build status npm downloads Logeek benchmark results

##Why not using native log? Native log is good, but you almost always delete it after you finish your work. One reason can be logs are for developers so it's better to remove them after finishing the job. The other reason is that when team working comes in, everyone try to get the upper hand in logging. You might have seen funny delimiters like ---------- My Name -------- or red color messages all over your console. Finally the team end up with a huge mess that no body can easily find their logs in it. logeek will fix all these issues in a very simple manner. Now that you know why using the native log is a bad idea, read the rest of this document to find the solution.

##Installation You can install it using bower or npm depending on your project type.

npm install logeek --save

or

bower install logeek --save

make sure to include the dist/logeek.js in your HTML or your Node application after you download it.

##Usage Logeek is easy to use, All you need to do is to include it and tell logeek which messages you want to be logged:

var logeek = require('logeek');

logeek.show('S');

logeek('M').at('S');

This means that message 'M' will be shown when scope 'S' is visible. Suppose you are working on a copy module and you want to log some message:

var logeek = require('logeek');

logeek.show('copy');                                  //setting the visible scope

logeek('reading the list of files form db').at('db');
logeek('investigating authentication').at('auth');
logeek('starting copy').at('copy');                   //logs starting copy
logeek('50% done').at('copy');                        //logs 50% done
logeek('A file was skipped').at('copy/skip');
logeek('100% done').at('copy');                       //logs 100% done
logeek('saving state in database').at('db');

This is what you'll see in your console:

starting copy
50% done
100% done

If you used logeek.show('copy/*') your console would be like:

starting copy
50% done
A file was skipped
100% done

##Nested Scopes Scopes are powerful ways to group your log message together and disable or enable them at a certain point. Not only you can create different groups, you can also nest these groups to create a relation between them and control them much easier.

logeek.show('sync/db/*');
logeek('communicating with server').at('sync');
logeek('pulling data for sync').at('sync/db');      //logs pulling...
logeek('Oops! there is not data in db').at('sync/db/error'); //logs Oops!...

//You can also set reverse filters
logeek.show('*/error');
logeek('creating database').at('db');
logeek('inserting new data').at('db/data');
logeek('error in insert').at('db/data/error');      //logs error in...
logeek('syncing data to server').at('sync');
logeek('server is not available').at('sync/error'); //logs server is not...

##compact mode Writing a long list of log messages can be a boring job. That's why logeek allows you to use an easier way of defining your message and scope at once. logeek uses '@' as the default delimiter for separating the message and the scope. The general format of compact message logging with logeek is:

logeek.show('db');

logeek('M @ S');

//these two are the same
logeek('creating database').at('db');
logeek('creating database @ db');

//these two are the same
logeek('inserting new data').at('db/data');
logeek('inserting new data @ db/data');
  

##Chalk Integration Logeek plays well with other standard libraries such as Chalk. Here is an example of using Logeek with Chalk to control the console logs like a pro:

var chalk = require('chalk'),
    logeek = require('logeek');

logeek.show('copy/*');
logeek(chalk.gray('copy started').at('copy');
logeek(chalk.green('50% done').at('copy');
logeek(chalk.gray('making md5 comparison').at('md5');
logeek(chalk.yellow('one file skipped').at('copy/skip');
logeek(chalk.red('error occured during coppy').at('copy/error');
logeek(chalk.gray('logging into db').at('db');
logeek(chalk.red('copy aborted') + '@ copy');

And this is what you see in your console:

Logeek Console Log

##And more... NPM