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

@mhlabs/structured-logging

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mhlabs/structured-logging - npm Package Compare versions

Comparing version 2.0.0-alpha to 2.0.1-alpha

2

package.json
{
"name": "@mhlabs/structured-logging",
"version": "2.0.0-alpha",
"version": "2.0.1-alpha",
"description": "A package for logging to console in a structured format",

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

@@ -20,4 +20,11 @@ let stack = 'default-stack';

Level: logLevel,
Metadata: metadata
Stack: stack
};
Object.keys(metadata).forEach(key => {
if (!data[key]) {
data[key] = metadata[key];
}
});
return JSON.stringify(data);

@@ -63,3 +70,2 @@ }

silentMode = false;
baseMetadata.stack = stack;

@@ -66,0 +72,0 @@ this.setSilentMode = silent => {

@@ -14,3 +14,3 @@ const StructuredLogger = require('./structuredLogger');

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"INFO","Metadata":{"entityId":"123","stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"INFO","Stack":"virtual-test-stack","entityId":"123"}'
);

@@ -22,3 +22,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"WARN","Metadata":{"entityId":"123","stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"WARN","Stack":"virtual-test-stack","entityId":"123"}'
);

@@ -30,3 +30,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Metadata":{"entityId":"123","stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Stack":"virtual-test-stack","entityId":"123"}'
);

@@ -38,3 +38,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"ERROR","Metadata":{"entityId":"123","stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"ERROR","Stack":"virtual-test-stack","entityId":"123"}'
);

@@ -49,3 +49,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Metadata":{"memberId":123,"orderId":321,"stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Stack":"virtual-test-stack","memberId":123,"orderId":321}'
);

@@ -57,3 +57,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Metadata":{"stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Stack":"virtual-test-stack"}'
);

@@ -65,3 +65,3 @@ });

expect(log).toEqual(
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Metadata":{"stack":"virtual-test-stack"}}'
'{"Message":"My name is Bond, James Bond.","Level":"DEBUG","Stack":"virtual-test-stack"}'
);

@@ -68,0 +68,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