Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1003 Bytes

README.md

File metadata and controls

34 lines (24 loc) · 1003 Bytes

npm version tests coverage

logger

A simple logging utility.

Can log simple messages along with:

  • arbitrary data, presented «as is» to view in the browser console or formatted to a json (configurable).
  • ability to throw an error along with log messages, stopping execution.
  • ability to alert a message using browser «alert».

Install

npm install @aliser/logger

Usage

import Logger from "@aliser/logger";

// 1. log using one of the methods
const logger = new Logger();
logger.logInfo(msg);

// 2. or destructure the methods you need
const logger = new Logger();
const { logInfo, logError } = logger;
logInfo(msg);