loggi

A memory log util for JavaScript Applications

Usage no npm install needed!

<script type="module">
  import loggi from 'https://cdn.skypack.dev/loggi';
</script>

README

loggi

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'