-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log arguments in extra so that they do not need to be stringified #398
Conversation
Log arguments in extra so that they do not need to be stringified. This provides more context for use when debugging errors.
@@ -23,7 +23,7 @@ var logForGivenLevel = function(level) { | |||
if (level === 'warn') level = 'warning'; | |||
return function () { | |||
var args = [].slice.call(arguments); | |||
Raven.captureMessage('' + args, {level: level, logger: 'console'}); | |||
Raven.captureMessage('' + args[0], {level: level, logger: 'console', extra: { args: args }}); |
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.
Would we want to do { args: args.slice(1) }
instead? Since this is already sending the first argument as the message.
Also, I think I'd prefer to send the key as arguments
rather than args
since arguments
is what it's really called. :)
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.
Re args.slice(1): I would prefer to keep all all the arguments in extras because you can have a complex object in the first argument of console.xxx() as well. You do not want to have to recommit your code just because you forgot that the first argument should be a string...
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.
Ah, that's probably reasonable. 👍
So the intent becomes more clear.
Thanks! 🍰 🎉 |
Log arguments in extra so that they do not need to be stringified
Thank you for accepting the branch - and THANK YOU for RavenJS and Sentry! |
Log arguments in extra so that they do not need to be stringified. This provides more context for use when debugging errors.