Skip to content

fuchstim/logger

Repository files navigation


@ftim/logger

@ftim/logger is a lightweight, no-frills logging library.
Explore the docs »

Report Bug · Request Feature

Installation

To install the library, run npm install --save @ftim/logger

Usage

Example:

import Logger from '@ftim/logger';

Logger.warn('Hello world!');
// (warn) Hello world!

const namespacedLogger = Logger.ns('test-namespace');
namespacedLogger.info('Hello world from a namespace!');
// (info)[test-namespace] Hello world from a namespace!

const nestedNamespacedLogger = namespacedLogger.ns('we', 'have', 'to', 'go', 'deeper');
nestedNamespacedLogger.error('We went too far');
// (error)[test-namespace][we][have][to][go][deeper] We went too far

See here for all available client methods.