-
Notifications
You must be signed in to change notification settings - Fork 337
Add stacktrace logging #339
Add stacktrace logging #339
Conversation
43db2a8
to
e2f9ab7
Compare
www/codePushUtil.ts
Outdated
@@ -66,7 +66,11 @@ class CodePushUtil { | |||
*/ | |||
public static logError(message: String, error?: Error): void { | |||
var errorMessage = message || "" + " " + CodePushUtil.getErrorMessage(error); | |||
console.error(CodePushUtil.TAG + " " + errorMessage); | |||
var stackTrace = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to use let
instead of var
and const
instead of let
if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thx
www/codePushUtil.ts
Outdated
if (error.stack) { | ||
stackTrace += '. Stacktrace: ' + error.stack; | ||
} | ||
console.error(CodePushUtil.TAG + " " + errorMessage + stackTrace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use template literals
for text formatting instead of +
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thx
bin/www/codePushUtil.js
Outdated
console.error(CodePushUtil.TAG + " " + errorMessage); | ||
var stackTrace = ''; | ||
if (error.stack) { | ||
stackTrace += '. Stacktrace: ' + error.stack; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stacktrace -> StackTrace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thx
7801b9b
to
8a63002
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR add stacktrace logging which is will be very handy to debug errors.