Giter Site home page Giter Site logo

nodelog's Introduction

nodelog

@ajayos/nodelog is a Node.js module for log messages with customizable severity levels and output formats.

Installation

To install @ajayos/nodelog, run:

npm install @ajayos/nodelog

Usage

First, import the module into your Node.js application:

const nodelog = require('@ajayos/nodelog');

you can log messages with the log method:

log('This is an informational message', 'info');
log('This is a warning message', 'warn');
log('This is an error message', 'error');

You can also log messages with the default severity level by omitting the second argument:

log('This is a default message');

for Line

log()

Message Types

The following message types are available for the log method:

  • info   (or i): Informational message (green text)
  • warn   (or w): Warning message (yellow text)
  • error (or e): Error message (red text)
  • debug (or d): Debug message (magenta text)
  • fatal (or f): Fatal message (white text on red background)
  • line  (or l): Horizontal line (cyan text)

Output Format

The output format for each message type is as follows:

  • Informational message (green text): [timestamp] [*]> message
  • Warning message (yellow text): [timestamp] [!]> message
  • Error message (red text): [timestamp] [x]> message
  • Debug message (magenta text): [timestamp] [*]> message
  • Fatal message (white text on red background): [timestamp] [!]> message
  • Horizontal line (cyan text): >-----------------------------<

License

nodelogger is released under the Apache-2.0 License.

nodelog's People

Contributors

ajayos avatar

Stargazers

 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.