Socket
Socket
Sign inDemoInstall

levenlabs-log

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

4

CHANGELOG.md
## Changelog ##
### 0.1.1 ###
* Don't treat rpc errors as an Error
### 0.1.0 ###
* Handle `keyVals` being a string or number
* Stable release
* Added `LLOG_LEVEL` env variable parsing

@@ -7,0 +11,0 @@ ### 0.0.2 ###

9

log.js

@@ -110,7 +110,10 @@ if (typeof require === 'function') {

//if its an error and has a message, otherwise just fallback to toString()
if (val.hasOwnProperty('message')) {
//specifically look for data since rpc "errors" contain those and we
//don't want to treat those as errors
if (val instanceof Error || (val.hasOwnProperty('message') && val.hasOwnProperty('code') && !val.hasOwnProperty('data'))) {
str = val.message;
if (val.hasOwnProperty('code')) {
return val.message + ' (Code: ' + val.code + ')';
str += ' (Code: ' + val.code + ')';
}
return val.message;
return str
}

@@ -117,0 +120,0 @@ if (typeof val.toString === 'function') {

{
"name": "levenlabs-log",
"version": "0.1.0",
"version": "0.1.1",
"description": "Leven Labs Logging",

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

@@ -181,2 +181,4 @@ var logFilename = '../log.js',

test.equal(lastWrite, '~ [date] DEBUG -- -- error="test (Code: 1)"\n');
log.debug('', {error: {message: 'test', code: 1, data: 'hey'}});
test.equal(lastWrite, '~ [date] DEBUG -- -- error="{\\"message\\":\\"test\\",\\"code\\":1,\\"data\\":\\"hey\\"}"\n');
test.done();

@@ -183,0 +185,0 @@ };

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