Skip to content

Enabling different logs with differing log levels within a single application

License

Notifications You must be signed in to change notification settings

davehermann/multi-level-logger

Repository files navigation

multi-level-logger

A simple logging module with flexibility for multiple simultaneous log levels through named logs, and optional timestamp, code location, and color inclusion.

Detailed Documentation is available here

Getting Started

Install

npm install multi-level-logger --only=prod

  • Installing with --only=prod is highly recommended as multi-level-logger does not have any run-time dependencies

Quick Start

import { Warn } from "multi-level-logger";

Warn("Hello multi-level-logger");
> 1/1/2018, 12:00:00 PM - [line 3: ./log-example.js] - Hello multi-level-logger

Recent Releases

*See What's new in the documentation for additional details

v2.1.0 - Lazy Evaluation

  • Adds support for passing a function method as data
    • Function evaluation occurs only when the log level will be written

v2.0 - Major Release

  • Typescript declarations
  • optional - Code location from the stack trace
  • optional - Console colors
  • Breaking Changes

About

Enabling different logs with differing log levels within a single application

Resources

License

Stars

Watchers

Forks

Packages

No packages published