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

demnehlog

v0.0.9

Published

A Log Framework, colored console log,telnet client,Mongo Provider for store logs

Downloads

8

Readme

Demneh Logger

NPM Version NPM Downloads

Table of Contents

Install

$ npm install demnehlog

Introduction

This is a node.js module for store and show nodejs logs in console,mongo and from telnet. It is written in JavaScript, does not require compiling.

Here is an example on how to use it:

var DemnehLog = require('demnehlog');
var consoleProvider = new DemnehLog.ProviderConsole();

var logger1 = new DemnehLog.Logger([consoleProvider], ['date,title,text']);

logger1.info('tag', 'this is an info log');
logger1.error('tag', 'this is an error');
logger1.fatal('tag', 'this is a fatal error');
logger1.debug('tag', 'this is a debug log');
logger1.warning('tag', 'this is a warning');

Logger class used to make an object of logger with one or multiple providers. you can initilize multiple Logger for diffrent porpuse.In this sample we make a object of Logger as 'testlogger' with a console provider that show all logs on console screen with 'date,title,text' format, the output is :

alt tag

Classes

demnehlog has 2 parts as describe below:

  • Providers: Providers are the way that you choose to store or show your logs,For instance by ProviderMongo provider you can store your logs in mongoDb permanently, in this version we have 3 providers : ProviderConsole Shows all logs on console screen. ProviderMongo Stores logs in mongoDb Database. ProviderTelnet Sends logs immediately to telnet clients that already connected.

  • Logger: instance of Logger is a compination or diffrent providers you choose and the log format that the provider must provide.For instance in above example :

var logger2 = new DemnehLog.Logger([consoleProvider], ['date,title,text']);

we set consoleProvider with data,title,text format, the date means when log occours and title meanse which type of message occours (Info,Error,fatal,Debug,warning) and the text means whats happend?. as you can see in the output picture of example1 the logs in like :

(2017/2/6 - 15:15:51.193) Warning  |   this is a warning
        ^                   ^              ^
        |                   |              |
DATE----            TITLE---        TEXT---

you can set any combination you want as provider format , for example :

var logger2 = new DemnehLog.Logger([consoleProvider], ['title,text']);

alt tag

in this logger1 as you see , logs show without date

ProviderConsole

Comming soon.

ProviderMongo

Comming soon.

ProviderTelnet

Comming soon.

Full Example

Comming soon.

Whats Next

We are going to improve ProviderTelnet to be more customizable.

Feedback

You can send your feedbacks on https://github.com/kiarsy/DemnehLog also you can join to project for helping improve demnehLog together.