Console.log messages not showing up in Chrome'

2019-01-17 14:13发布

I am logging using the jQuery.log plugin (which logs to console.log if available) and I am not seeing any of the logging messages appear in the Chrome JavaScript console.

Logging works on Firebug's console under Firefox, but I did have to explicitly enable the Firebug JavaScript console. Have a missed some option somewhere under Chrome?

Edit:
The only thing being logged to the console is

Uncaught Syntax error, unrecognized expression: |button

I assume that the Chrome console is suppose to log statements even after errors like the one above, but there may be some kind of issue with Chrome here, see http://code.google.com/p/chromium/issues/detail?id=29062. I am using Chrome 5.0.375 under Linux and that bug is listed as a Windows XP, Chrome 4.0 issue, it could still apply.

6条回答
男人必须洒脱
2楼-- · 2019-01-17 14:43

I've just had the same problem and found this question when trying to find an answer.

What fixed this for me was disabling firebug lite in chrome. It was swallowing all console messages.

查看更多
放荡不羁爱自由
3楼-- · 2019-01-17 14:52

When playing around with example Chrome Extensions, I was often unable to see the console.log messages when looking at console (ctrl+shift+j). But then I realized, that I was in the wrong place.

Wrench -> Tools -> Extensions and then click on the appropriate link under "Inspect active views". (in the Chrome examples it is often background.html) This should bring up the console that you are looking for.

查看更多
孤傲高冷的网名
4楼-- · 2019-01-17 15:00

I just found out logging was disabled from my filters.

filters with logging

查看更多
Anthone
5楼-- · 2019-01-17 15:03

I am not sure if this is the case, but if you are using firebug with chrome, you have to turn firebug off in order for console.log() to work in Developer Tools.

查看更多
Root(大扎)
6楼-- · 2019-01-17 15:04

Make sure you have the console showing and that it is showing "All".

The cursor is on the button to hide/show the console.

alt text http://i29.tinypic.com/6jm2zc.jpg


Update: In newer versions of Chrome, you need to click the filter icon, then make sure "All" is selected.

console filter

查看更多
乱世女痞
7楼-- · 2019-01-17 15:06

On my computer I had accidently clicked the Debug filter. This made my log messages hidden. Here's how it was before (hidden messages): Chrome log not showing messages

Here's how it was after the change (working messages): enter image description here

查看更多
登录 后发表回答