Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bakjs/logging

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bakjs/logging - npm Package Compare versions

Comparing version 2.6.1 to 2.7.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [2.7.0](https://github.com/bakjs/bak/compare/@bakjs/logging@0.3.1...@bakjs/logging@2.7.0) (2018-11-19)
### Features
* improve logging plugin ([94d64f2](https://github.com/bakjs/bak/commit/94d64f2))
## [2.6.1](https://github.com/bakjs/plugins/compare/@bakjs/logging@2.6.0...@bakjs/logging@2.6.1) (2018-11-05)

@@ -8,0 +19,0 @@

25

lib/index.js

@@ -1,23 +0,18 @@

const { parseRequest, commonFormat } = require('./utils')
const consola = require('consola')
exports.register = function (server, options) {
const isDev = process.env.NODE_ENV !== 'production'
server.events.on(
{ name: 'request', channels: ['error', 'internal'] }, (request, { error, timestamp }, tags) => {
{ name: 'request', channels: ['error', 'internal'] }, (_, { error, timestamp }, tags) => {
if (!error) {
return
return
}
if (error.output && error.output.statusCode === 404) {
return
}
// Parse request
const reqInfo = parseRequest(request, timestamp)
if (isDev) {
consola.error(error)
consola.info(reqInfo)
} else {
// Log with common log format
consola.log(commonFormat(reqInfo))
}
consola.error({
message: error,
tag: Object.keys(tags),
time: timestamp
})
}

@@ -24,0 +19,0 @@ )

8

package.json
{
"name": "@bakjs/logging",
"version": "2.6.1",
"version": "2.7.0",
"repository": "bakjs/bak",
"license": "MIT",

@@ -16,5 +17,4 @@ "main": "lib/index.js",

"dependencies": {
"consola": "^2.2.2"
},
"gitHead": "9ef4dd57b351461c3baaaf397cfa220d90ee12f0"
"consola": "^2.3.0"
}
}
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