数组中的Firebug控制台缩短字符串是否记录? [英] Firebug console shortening strings in array logged?

查看:162
本文介绍了数组中的Firebug控制台缩短字符串是否记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义日志功能来登录到firebug控制台,如下所示:

 只是为了乐趣
function ninjaConsoleLog(){
var slicer = Array.prototype.slice;
var args = slicer.call(arguments);
console.log(args);
}

它的工作原理就像我想要的....除了if我有在字符串值超过约7个字在数组中,除了前两个字和最后两个字,Firebug控制台隐藏字符串值。 (约)



示例:

  ninjaConsoleLog一个长长的字符串,像激励兔子,它只是继续前进和去。 

上述函数调用会导致以下输出到firebug控制台:

  [这是一个漫长的过程... ...)

这很好,除了有时控制台缩写的字符串部分包含重要数据。



首先,为什么会发生这种情况?



其次,使用我当前的日志功能,我可以强制控制台输出数组中每个项目的完整字符串值?或者只是在查看控制台的输出时查看整个字符串?



还是这不可能?



/ strong>

解决方案

尝试将其更改为console.dir(args)

此外,你应该能够点击firebug控制台中的值来展开它们的完整值
在框符号中有一个加号,该值将变为带下划线,这意味着点击它将会扩展到其完整值


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!!

解决方案

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

这篇关于数组中的Firebug控制台缩短字符串是否记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆