@appsignal/plugin-breadcrumbs-console
Advanced tools
Comparing version 1.1.19 to 1.1.20
# AppSignal for plugin-breadcrumbs-console changelog | ||
## 1.1.20 | ||
- [7d138c6](https://github.com/appsignal/appsignal-javascript/commit/7d138c67783edc3fa4b2b8b481659c4b8936a57e) patch - Fix the error that was thrown when a circular structure console argument was logged. It will no longer throw the error and instead send a replacement value of the value that could not be send as a JSON value. | ||
## 1.1.19 | ||
@@ -4,0 +8,0 @@ |
@@ -28,3 +28,3 @@ "use strict"; | ||
return (breadcrumb.metadata["argument" + i] = | ||
typeof arg === "string" ? arg : JSON.stringify(arg)); | ||
serializeValue(arg, method)); | ||
}); | ||
@@ -39,3 +39,17 @@ self.addBreadcrumb(breadcrumb); | ||
} | ||
function serializeValue(value, method) { | ||
if (typeof value === "string") { | ||
return value; | ||
} | ||
else { | ||
try { | ||
return JSON.stringify(value); | ||
} | ||
catch (error) { | ||
console.error("Could not serialize \"console." + method + "\" to String.", error); | ||
return "[Value could not be serialized]"; | ||
} | ||
} | ||
} | ||
exports.plugin = consoleBreadcrumbsPlugin; | ||
//# sourceMappingURL=index.js.map |
@@ -25,3 +25,3 @@ var SUPPORTED_CONSOLE_METHODS = ["log", "debug", "info", "warn", "error"]; | ||
return (breadcrumb.metadata["argument" + i] = | ||
typeof arg === "string" ? arg : JSON.stringify(arg)); | ||
serializeValue(arg, method)); | ||
}); | ||
@@ -36,3 +36,17 @@ self.addBreadcrumb(breadcrumb); | ||
} | ||
function serializeValue(value, method) { | ||
if (typeof value === "string") { | ||
return value; | ||
} | ||
else { | ||
try { | ||
return JSON.stringify(value); | ||
} | ||
catch (error) { | ||
console.error("Could not serialize \"console." + method + "\" to String.", error); | ||
return "[Value could not be serialized]"; | ||
} | ||
} | ||
} | ||
export var plugin = consoleBreadcrumbsPlugin; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@appsignal/plugin-breadcrumbs-console", | ||
"version": "1.1.19", | ||
"version": "1.1.20", | ||
"main": "dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/esm/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
14272
113