-
Notifications
You must be signed in to change notification settings - Fork 508
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
console.log support for multiple arguments #433
Conversation
💖 Thanks for opening this pull request! 💖 |
js/editor-libs/console-utils.js
Outdated
'use strict'; | ||
var output = ''; | ||
output = output + this.formatOutput(args[0]); | ||
for (var i=1; i<args.length; i++) { |
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.
Code style nits: Change to
for (var i = 1, l = args.length; i < l; i++) {
js/editor-libs/console.js
Outdated
console.log = function(loggedItem) { | ||
consoleUtils.writeOutput(consoleUtils.formatOutput(loggedItem)); | ||
console.log = function() { | ||
consoleUtils.writeOutput(consoleUtils.concatOutput(arguments)); |
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.
Perhaps the context is making this a little blurry but, it seems that this change will mean we loose the formatting done by formatOutput
. That is definitely something we do not want to happen. Perhaps we should instead loop over the arguments, passing each one to the format function before concatenating together?
@qwIvan Thank you for your contribution. Couple of items to review. I also want to note that, unless you change your current avatar, I will not in good faith be able to merge this pull request and add you as a contributor. The image depicts something that I feel is disrespectful to woman, and this goes against out code of conduct |
deleted concat function |
@qwIvan Thank you for the updates. It is looking good. I have run into one problem where the value The example I saw that with is |
Convert undefined to String and resolved. |
That is indeed the simplest solution, I wonder though, do we want to output it as a string? It is not a @wbamberg Your thoughts? |
I see this:
This looks fine, so unless there is some subtlety I am missing, I'm happy with it :). |
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.
r+
Congrats on merging your first pull request! 🎉🎉🎉 |
such as
console.log('Hello', 'World', '!');