Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bearer/logger

Package Overview
Dependencies
Maintainers
4
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearer/logger

Bearer logger

  • 0.107.0-canary-tarik.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
decreased by-78.99%
Maintainers
4
Weekly downloads
 
Created
Source

@bearer/logger

Usage

We recommend to create a logger file within you project

// my-logger.ts
import debug from '@bearer/logger'

export default () => debug('my-package-name')

then in your app

import debug from 'path/to/my-logger'

const logger = debug()
logger('message to debug')
logger({ object: 'something' })

// sub logger

const subLogger = logger.extend('sub-feature')
subLogger('blablabl')

You'll need to set DEBUG=* to see all logs or DEBUG=bearer:my-package-name to see logs produced by your application.

Browser support

We assume you are writing a bearer integration.

views/src/my-component.tsx

import debug from '@bearer/logger'

const logger = debug('a-scope-you-provide')

class MyComponent {
  componentDidLoad() {
    logger('Loaded')
  }
}

if you want to see logs you must enable it by setting the localStorage.debug value from your console

Show all logs

localStorage.debug = '*'

Show bearer logs only

localStorage.debug = 'bearer:*'

Show your integration logs only

localStorage.debug = 'bearer:a-scope-you-provide:*'

Keywords

FAQs

Package last updated on 28 Mar 2019

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc