@geek/logger
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -308,9 +308,14 @@ 'use strict'; | ||
const checkForError = params => { | ||
// console.error(params instanceof Error); | ||
if (params instanceof Error) { | ||
// const result = JSON.parse(JSON.stringify(params)); | ||
// console.debug(`🦠 params=error: ${JSON.stringify(params, null, 2)}`); | ||
const result = { ...params }; | ||
console.warn(result instanceof Error); | ||
// console.warn(result instanceof Error); | ||
result.stack_array = _.split(params.stack, '\n').filter(o => o); | ||
result.error_message = params.message; | ||
result.line = params.line; | ||
result.column = params.column; | ||
result.message = undefined; | ||
// console.debug(result); | ||
return result; | ||
@@ -328,2 +333,4 @@ } else { | ||
params = {}; | ||
} else { | ||
params = checkForError(params); | ||
} | ||
@@ -330,0 +337,0 @@ |
{ | ||
"name": "@geek/logger", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Logging module for Node.js and Axway Titanium", | ||
@@ -54,3 +54,3 @@ "main": "Logger.js", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jsdoc": "^30.6.2", | ||
"eslint-plugin-jsdoc": "^30.6.3", | ||
"eslint-plugin-promise": "^4.2.1", | ||
@@ -57,0 +57,0 @@ "fs-extra": "^9.0.1", |
@@ -7,9 +7,11 @@ | ||
this.event = ({ message, level, ...args }) => { | ||
this.event = (params = {}) => { | ||
const result = Ti.Analytics.featureEvent(message, args); | ||
params = { ...params }; | ||
delete params.stack_array; | ||
const result = Ti.Analytics.featureEvent(params.message, params); | ||
if (result === -1) { | ||
console.warn(`🗓️ Ti.Analytics.featureEvent - Validation Error: ${message}`, args); | ||
console.warn(`🗓️ Ti.Analytics.featureEvent - Validation Error: ${params.message}`, params); | ||
} else if (result === -2) { | ||
console.warn(`🗓️ Ti.Analytics.featureEvent - Validation Disabled: ${message}`, args); | ||
console.warn(`🗓️ Ti.Analytics.featureEvent - Validation Disabled: ${params.message}`, params); | ||
} | ||
@@ -16,0 +18,0 @@ }; |
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
87351
906