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

@everymundo/simple-logr

Package Overview
Dependencies
Maintainers
34
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everymundo/simple-logr - npm Package Compare versions

Comparing version 2.0.4 to 2.1.0

23

index.js
'use strict'
const pino = require('pino')
const flatstr = require('flatstr')
const defaultOptions = {
level: process.env.LOG_LEVEL || 'info',
timestamp: !process.env.LOG_NODATE,
get timestamp () {
if (process.env.LOG_NODATE) {
return false
}
if (process.env.LOG_DATE_FORMAT in pino.stdTimeFunctions) {
return pino.stdTimeFunctions[process.env.LOG_DATE_FORMAT]
}
return pino.stdTimeFunctions.epochTime
},
useLevelLabels: true,

@@ -12,7 +23,17 @@ base: null

// Default is this
// ',"pid":2365,"hostname":"daniel-XPS-15-7590"'
function setRequestId (RequestId) {
this[pino.symbols.chindingsSym] = flatstr(`,"RequestId":${JSON.stringify(RequestId)}`)
}
const createLogger = (options = {}) => {
const pinoOptions = { ...defaultOptions, ...options }
const mainLogr = pino(pinoOptions)
mainLogr.createLogger = createLogger
mainLogr.setRequestId = setRequestId
mainLogr[pino.symbols.endSym] = '}\n'
return mainLogr

@@ -19,0 +40,0 @@ }

2

package.json
{
"name": "@everymundo/simple-logr",
"version": "2.0.4",
"version": "2.1.0",
"description": "A very simplistic logger that allows one to avoid using the console.log directly allowing stubbing and better linting.",

@@ -5,0 +5,0 @@ "main": "index.js",

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