# 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.

# Getting Started

# Install

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

Installation

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
2
3
> 1/1/2018, 12:00:00 PM - [line 3: ./log-example.js] - Hello multi-level-logger

# What's New

# v2.1.0

  • Lazy evaluate log data when a log is written by passing a function that returns a string/object instead of passing the string/object

# v2.0.0

  • Rewritten in Typescript
    • Typescript declarations are included
  • Code location for log calls pulled from the stack trace!
  • Console Colors!
  • Support for LOG_LEVEL environment variable to set log level

See Migrating from v1.x to v2.x for breaking changes to the API

# License

multi-level-logger is released under the MIT License. See License (opens new window) file for more details.

# Contributing

Pull requests may be considered provided they follow existing code's styling, are well commented, and pass all existing tests as well as provide new tests as-needed.