Git Product home page Git Product logo

benchlogga's Introduction

Benchlogga

Dependabot Status

A nodejs logging and benchmarking package.

Installation

npm i benchlogga
yarn add benchlogga

Usage

TypeScript

import { Benchlogga } from 'benchlogga';

const logger1 = new Benchlogga('SomeContext');
const logger2 = new Benchlogga('SomeOtherContext');

Javascript

var Benchlogga = require('benchlogga');

var logger = new Benchlogga('SomeContext');
var logger2 = new Benchlogga('SomeOtherContext');

Usage

Basic usage looks like this

logger.log('Hello from one of my modules');
logger.log('Some other event from the first module');
logger2.log('Hello from a differnet module');
setTimeout(() => logger.log('something that happened later'), 200);

The above would output something like this

[pid] 61380 - 01/28/2020, 12:28:45 AM  [SomeContext] Hello from one of my modules
[pid] 61380 - 01/28/2020, 12:28:45 AM  [SomeContext] Some other event from the first module +252.486 μs
[pid] 61380 - 01/28/2020, 12:28:45 AM  [SomeOtherContext] Hello from a different module
[pid] 61380 - 01/28/2020, 12:28:46 AM  [SomeContext] something that happened later +204.113158 ms

Benchlogga comes with 5 different message types

logger.log('string message')
logger.warn('string message')
logger.debug('string message')
logger.verbose('string message')
logger.error('string message', 'stack trace')
// or
logger.error(new Error('string message'))

The primary difference between them is the colors they display. For example, the above results in something that looks like this image

Roadmap

Currently it's mainly in the form of performance. can't have decent benchmarking if the logger is taking up too much time internally.

benchlogga's People

Contributors

dependabot-preview[bot] avatar ziazon avatar dependabot[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.