Skip to content

helpscout/loggi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loggi

Build Status Coverage Status npm version

A memory log util for JavaScript Applications

Table of contents

🔧 Installation

npm install loggi --save

🕹 Usage

Basic Usage

import createLogger from 'loggi'

const Logger = createLogger()

Logger.log('log message')
Logger.info('info message')
Logger.warn('warn message')
Logger.error('error message')

Log Levels and Debug

import createLogger, { LOG_LEVELS } from 'loggi'

const Logger = createLogger({
  logLevel: LOG_LEVELS.ERROR,
})

Logger.log('log message')
Logger.info('info message')
Logger.warn('warn message')
Logger.error('error message')

// Prints:
// > error: 'error message'

Logger.debug()

// Prints:
// > log: 'log message'
// > info: 'info message'
// > warn: 'warn message'
// > error: 'error message'