Skip to content

infobiotech/js-logger

Repository files navigation

@infobiotech/js-logger

An helper static class to handle logging on JavaScript projects such as Node.js, React and React Native.

Installation

yarn add @infobiotech/js-logger

Or

npm install @infobiotech/js-logger

Basic usage

import logger from '@infobiotech/js-logger';

// other imports...

// Initialize the logger with application-wide log level
logger.init({
  logLevel: logger.INFO,
});

// for each container, set the name and the log level
const logContainerName = 'App';
logger.setLogLevel(log.INFO, logContainerName);

logger.info(logContainerName, 'methodName', 'message', {
  // data keys to be logged
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published