Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

loghere

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loghere

可以在 PM2 和 Serverless 中使用的一款简易日志工具

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

loghere

可以在 PM2 和 Serverless 中使用的一款简易日志工具

简介

在 Node.js 中,比较成熟的日志工具是 log4js,但是由于种种原因,在和 pm2 搭配使用时,log4js 打印的日志很难被 pm2 接收,需要进行很多的额外配置。loghere 就是为了解决这个问题诞生的。与 log4js 的功能完整相比,loghere 只提供了非常轻量级的功能,同时保持了和 log4js 类似的 API,使用上非常简单。

安装

直接使用 npm 命令安装即可:

npm i loghere

使用

const loghere = require('loghere')    // 引用
const logger = loghere.getLogger()    // 获取日志实例
logger.level = 'debug'				  // 设置日志等级
logger.debug('这是日志内容')            // 打日志

日志等级

包含以下日志等级:

  • ALL (默认)
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL
  • MARK
  • OFF

FAQs

Package last updated on 10 Oct 2020

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