@cantinc/logger

CANT inc. log system

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@cantinc/logger
101.1.03 years ago3 years agoMinified + gzip package size for @cantinc/logger in KB

Readme

CANT.store
  logger
 
NPM size downloads changelog license
CANT inc. log system
stars watchers

Install

npm
npm i @cantinc/logger

yarn
yarn add @cantinc/logger

cdn
<script defer src="https://unpkg.com/@cantinc/logger/logger.min.js"></script>

Usage

Simple example

import logger from '@cantinc/logger'

const eventId = 'test'

logger.start(eventId)

// do somethink

logger.end(eventId)

Complex example

CANT inc. Logger Example
You will get the same picture if you run the next code
logger.start('Main test')

logger.log('Some message')

logger.start('Inside test with message')
logger.log('Inside message')
logger.end('Inside test with message')

logger.start('Inside test without message')
logger.end('Inside test without message')

logger.start('Test with error')
logger.log('Inside message')
logger.end('Test with error', 'Error text')

logger.start('Message Chaining')
logger.next('Message Chaining', 'Step1')
logger.next('Step1', 'Step2')
logger.next('Step2', 'Step3', 'Step2 Error Message')
logger.end('Step3')

logger.start('Callback Running', () => {
  logger.log('Callback Message')
})

logger.start('Async Callback', async () => {
  logger.log('Async Message')
})

logger.start('Async Callback with error', async () => {
  throw Error('Test Error')
})

logger.end('Main test')

Issues

If you find a bug or have a suggestion, please file an issue on GitHub.
issues