Skip to content

chrisBas/basic-node-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

basic-node-logger

NPM version

A basic logger for Node.js applications that was influenced by the standard logging in Java-Spring.

Installation

npm install basic-node-logger

How to use

Simply create a logger instance and use it to log messages at various levels optionally including custom configuration and/or supplying a request ID.

import { BasicLogger } from "basic-node-logger";

const logger = new BasicLogger({
  name: "myApp",
  logLevel: "TRACE",
});

logger.fatal("This is a fatal message");
logger.error("This is an error message");
logger.warn("This is a warning message");
logger.info("This is an info message");
logger.debug("This is a debug message");
logger.trace("This is a trace message");

The output of the above commands will look like this:

Screenshot of a terminal outputting log messages at various levels.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors