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

ecs-logs-js

Package Overview
Dependencies
Maintainers
33
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecs-logs-js - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

4

History.md

@@ -0,2 +1,6 @@

0.2.0
=====
* Don't swallow errors when they are logged at the top level.
0.1.0

@@ -3,0 +7,0 @@ =====

@@ -274,2 +274,5 @@ /**

function extractErrors(obj) {
if (obj instanceof Error) {
return [obj];
}
var errors = [];

@@ -276,0 +279,0 @@

2

package.json
{
"name": "ecs-logs-js",
"version": "0.1.0",
"version": "0.2.0",
"description": "Logger based on winston formatting messages compatible with ecs-logs",

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

@@ -356,3 +356,3 @@ var assert = require('assert');

it('should not produce log messages bellow warnings', function() {
it('should produce log messages with top-level errors', function() {
var messages = [];

@@ -363,2 +363,41 @@ var logger = new ecslogs.Logger({

},
timestamp: now,
hostname: 'localhost'
});
logger.error('something went wrong', new TestError('oops!'));
assert.deepEqual(messages, [
{
level: 'ERROR',
time: '2016-07-02T21:11:47.000Z',
info: {
host: 'localhost',
errors: [
{
type: 'TestError',
error: 'oops!',
stack: [
'at test3 (test.js:3:1)',
'at test2 (test.js:2:1)',
'at test1 (test.js:1:1)'
],
}
]
},
data: {
message: 'oops!',
stack: "Error: oops!\n\tat test3 (test.js:3:1)\n\tat test2 (test.js:2:1)\n\tat test1 (test.js:1:1)\n"
},
message: 'something went wrong'
}
]);
});
it('should not produce log messages below warnings', function() {
var messages = [];
var logger = new ecslogs.Logger({
output: function(msg) {
messages.push(JSON.parse(msg))
},
level: 'warn',

@@ -365,0 +404,0 @@ timestamp: now,

Sorry, the diff of this file is not supported yet

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