@geek/logger
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -282,4 +282,6 @@ 'use strict'; | ||
const getLogParams = (message = '', params = {}) => { | ||
if (typeof message === 'object') { | ||
return message; | ||
// return message; | ||
params = checkForError(message); | ||
} else if (typeof message === 'string') { | ||
@@ -289,12 +291,27 @@ if (typeof params !== 'object') { | ||
params = {}; | ||
} else { | ||
params = checkForError(params); | ||
} | ||
params.message = message; | ||
return params; | ||
// return params; | ||
} else { | ||
console.warn('invalid parameters sent to Logger'); | ||
return { message: '' }; | ||
} | ||
console.warn('invalid parameters sent to Logger'); | ||
return { message: '' }; | ||
}; | ||
const checkForError = params => { | ||
if (params instanceof Error) { | ||
const result = {}; | ||
result.stack = params.stack; | ||
result.error_message = params.message; | ||
return result; | ||
} else { | ||
return params; | ||
} | ||
}; | ||
const getLogLevelParams = (level, message, params = {}) => { | ||
@@ -301,0 +318,0 @@ |
{ | ||
"name": "@geek/logger", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Logging module for Node.js and Axway Titanium", | ||
@@ -9,3 +9,3 @@ "main": "Logger.js", | ||
"prep": "npm install --ignore-scripts && npm run list", | ||
"prepublishOnly2": "git pull && bump", | ||
"prepublishOnly": "git pull && bump", | ||
"lint": "eslint --fix .", | ||
@@ -53,5 +53,5 @@ "test": "echo \"no test specified\" && exit 0" | ||
"@titanium/eslint-config": "0.0.17", | ||
"eslint": "^7.9.0", | ||
"eslint-plugin-import": "^2.22.0", | ||
"eslint-plugin-jsdoc": "^30.5.1", | ||
"eslint": "^7.10.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsdoc": "^30.6.2", | ||
"eslint-plugin-promise": "^4.2.1", | ||
@@ -58,0 +58,0 @@ "fs-extra": "^9.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86585
890