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

@sumor/logger

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sumor/logger - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

2

package.json
{
"name": "@sumor/logger",
"description": "This is a lightweight logger for Node.JS. It can output logs in different levels, and you can customize the scope, id, and timezone.",
"version": "1.2.5",
"version": "1.2.6",
"license": "MIT",

@@ -6,0 +6,0 @@ "repository": "sumor-cloud/logger",

@@ -196,1 +196,36 @@ # logger

```
### Filter Level
When you want to filter logs by level, you can use the following code:
```js
import Logger from '@sumor/logger'
const logger = new Logger({
level: 'info'
})
logger.trace('Hello World!') // trace is the lowest level, will not be output
logger.debug('Hello World!') // debug is lower than info, will not be output
logger.info('Hello World!') // info is the same as info, will be output
logger.warn('Hello World!') // warn is higher than info, will be output
logger.error('Hello World!') // error is higher than info, will be output
logger.fatal('Hello World!') // fatal is the highest level, will be output
```
When you use this library cross multiple libraries, you can use the following code:
```js
import Logger from '@sumor/logger'
const logger = new Logger()
process.env.LOG_LEVEL = 'info'
logger.trace('Hello World!') // trace is the lowest level, will not be output
logger.debug('Hello World!') // debug is lower than info, will not be output
logger.info('Hello World!') // info is the same as info, will be output
logger.warn('Hello World!') // warn is higher than info, will be output
logger.error('Hello World!') // error is higher than info, will be output
process.env.LOG_LEVEL = 'warn' // real-time change log level
logger.info('Hello World!') // info is lower than warn, will not be output
```
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