Socket
Socket
Sign inDemoInstall

@bucuo/json-logger

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bucuo/json-logger

Simple JSON logger.


Version published
Maintainers
1
Install size
47.9 kB
Created

Readme

Source

Logger

Simple JSON logger.

Install

npm install @bucuo/json-logger

Usage

const { logger } = require("@bucuo/json-logger");

logger.$level(msg, err, det);

Args are classified by types. You can pass in args in any order.

Arg Types

  • msg: string
  • err: Error or Object with string fields name, message and stack
  • det: plain Object

Default Levels

  • 60: fatal
  • 50: error
  • 40: warn
  • 30: info
  • 20: debug
  • 10: verbose

Default Options

see Default Options

Env Options

  • LOG_PRINT_LEVEL: number
  • LOG_PRINT_PRETTY: boolean
  • LOG_ENABLE_TS: boolean
  • LOG_ENABLE_TSS: boolean

Advanced

If you are not satisfied with the default logger and env options, you could build logger with pre-defined or customized bricks.

See

License

MIT

Keywords

FAQs

Last updated on 27 May 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc