Socket
Book a DemoInstallSign in
Socket

@cantinc/logger

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cantinc/logger

CANT inc. log system

1.1.0
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source
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

Keywords

log

FAQs

Package last updated on 15 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.