New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

zhi-log

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zhi-log

a simple logger for Node

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

zhi-log

a simple logger for Node

Features

  • 100% compatible with console
  • log level support
  • custom logger name
  • a simple LogFactory

Usage

Default devel is INFO

const logger = LogUtil.defaultLogFactory().getLogger()
logger.debug("This is debug log")
logger.info("This is info log")
logger.error("This is error log")

// [zhi] [11:26:51] INFO /Users/terwer/Documents/mydocs/zhi-log/test/log.test.ts:33:48 : This is info log
// [zhi] [11:26:51] ERROR /Users/terwer/Documents/mydocs/zhi-log/test/log.test.ts:33:48 : This is error log

You can set a custom log level

const logger = LogUtil.customLogFactory(LogLevelEnum.LOG_LEVEL_DEBUG).getLogger("test")
logger.debug("This is debug log")
logger.info("This is info log")
logger.error("This is error log")

// [zhi] [11:28:15] DEBUG test : This is debug log
// [zhi] [11:28:15] INFO test : This is info log
// [zhi] [11:28:15] ERROR test : This is error log

You can also set a custom prefix sign

const logger = LogUtil.customLogFactory(LogLevelEnum.LOG_LEVEL_DEBUG, "my-log").getLogger("test")
logger.debug("This is debug log")
logger.info("This is info log")
logger.error("This is error log")

// [my-log] [11:29:04] DEBUG test : This is debug log
// [my-log] [11:29:04] INFO test : This is info log
// [my-log] [11:29:04] ERROR test : This is error log

Keywords

FAQs

Package last updated on 07 Mar 2023

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