I have a custom logging function to log to the firebug console that looks like this:
// the name here is just for fun
function ninjaConsoleLog() {
var slicer = Array.prototype.slice;
var args = slicer.call(arguments);
console.log(args);
}
And it works exactly like I want it to....except that if I have string values longer than about 7 words in the array, the firebug console hides the string value except for the first two words and the last two words. (approx.)
Example:
ninjaConsoleLog("This is a longish string, like the energizer bunny, it just keeps going and going and going.");
The aforementioned function call results in the following output to the firebug console:
["This is a longish strin...going and going."]
This would be fine, except that sometimes the part of the string that the console abbreviates contains important data.
First off, why does this happen?
Second, with my current logging function, is there anyway that I can either force the console to output the full string value for each item in the array? Or just view the entire string when viewing the console's output?
Or is this not possible?
Thanks!!
If you want view the entire string(s) without having to expand the individual array items (dir() will list collapsed results), you can call
toString()
on the array, and Firebug will show you the entire array as a string, e.g.:... which results in this string:
This is a longish string, like the energizer bunny, it just keeps going and going and going.,Another longish string Another longish string Another longish string Another longish string.,A third longish string A third longish string A third longish string A third longish string.
Try changing it to console.dir(args) instead of console.log(args)
Also you should be able to click on the values in firebug console to expand them to their full values There will be either a plus in a box symbol or when you mouse over the value it will become underlined, which means clicking on it will expand to its full value