Socket
Socket
Sign inDemoInstall

gelf-pro

Package Overview
Dependencies
2
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

10

lib/gelf-pro.js

@@ -45,3 +45,3 @@ /**

/**
* Creates and return adapter
* Creates and return adapter (singleton)
* @returns {Object}

@@ -123,2 +123,10 @@ */

// trying to convert an error to readable message
if (_.isError(message)) {
message = message.message.toString() || 'Error';
}
if (_.isError(extra)) {
extra = {error: {message: extra.message, stack: extra.stack}};
}
// creating string from object

@@ -125,0 +133,0 @@ extra = this.getStringFromObject(

12

package.json
{
"name": "gelf-pro",
"version": "0.2.0",
"version": "0.3.0",
"main": "./lib/gelf-pro.js",

@@ -25,10 +25,10 @@ "author": "Kanstantsin Kamkou <kkamkou@gmail.com>",

"dependencies": {
"lodash": "~3.10",
"async": "~1.4"
"lodash": "~4.5",
"async": "~1.5"
},
"devDependencies": {
"should": "~7.1",
"mocha": "~2.3",
"sinon": "~1.16"
"should": "~8.2",
"mocha": "~2.4",
"sinon": "~1.17"
}
}

@@ -10,3 +10,3 @@ node-gelf pro

"dependencies": {
"gelf-pro": "~0.2"
"gelf-pro": "~0.3"
}

@@ -43,2 +43,5 @@ ```

log.info("Hello world");
log.info('Oooops.', new Error('An error message'));
log.info(new Error('An error message'));
```

@@ -45,0 +48,0 @@

@@ -70,3 +70,3 @@ 'use strict';

'Extra fileds normalization': function () {
'Normalize extra fields': function () {
var mock = sinon.mock(console);

@@ -95,2 +95,17 @@ mock.expects('warn').once().withExactArgs('the first value: the key format is not valid');

result.should.have.property('_level1_level2_level3_value3').equal('value3');
},
'Transform an Error object': function () {
var gelf = _.cloneDeep(gelfOriginal),
err = new Error('Some error message');
sinon.spy(gelf, 'getStringFromObject');
gelf.info(err);
gelf.info('Example', err);
JSON.parse(gelf.getStringFromObject.firstCall.returnValue)
.should.containEql({short_message: err.message.toString()});
JSON.parse(gelf.getStringFromObject.lastCall.returnValue)
.should.have.properties(['_error_message', '_error_stack']);
}

@@ -97,0 +112,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc