@libj/logger
Advanced tools
Comparing version 0.1.7 to 0.2.0
@@ -17,3 +17,4 @@ import { LoggerLevel } from '../LoggerLevel'; | ||
private extractFormatArgs; | ||
private isSprintfError; | ||
} | ||
export {}; |
@@ -31,3 +31,11 @@ "use strict"; | ||
: message; | ||
return this.sprintf(finalMessage, formatArgs); | ||
try { | ||
return this.sprintf(finalMessage, formatArgs); | ||
} | ||
catch (err) { | ||
if (this.isSprintfError(err)) { | ||
return finalMessage; | ||
} | ||
throw err; | ||
} | ||
}; | ||
@@ -57,2 +65,5 @@ BaseLogger.prototype.sprintf = function (message, args) { | ||
}; | ||
BaseLogger.prototype.isSprintfError = function (err) { | ||
return (err instanceof TypeError && err.message.includes('[sprintf]')); | ||
}; | ||
return BaseLogger; | ||
@@ -59,0 +70,0 @@ }()); |
@@ -6,3 +6,3 @@ { | ||
"name": "@libj/logger", | ||
"version": "0.1.7", | ||
"version": "0.2.0", | ||
"description": "Generic logger", | ||
@@ -29,3 +29,3 @@ "author": "Sergey Poskachey <seregynp@gmail.com>", | ||
], | ||
"gitHead": "402b4454728a916c29dd2a2e233ab1241d7f1e83" | ||
"gitHead": "6d868a93c5d1934959f020dcc9ac0669a1dc72d7" | ||
} |
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
16301
231