Skip to content
/ logger Public

Logs messsages and arbitrary data to the console, can throw errors.

License

Notifications You must be signed in to change notification settings

murolem/logger

Repository files navigation

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);

About

Logs messsages and arbitrary data to the console, can throw errors.

Resources

License

Stars

Watchers

Forks

Packages

No packages published