Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there any quick way of getting Chrome to output timestamps in console.log writes (like Firefox does).(是否有任何快速方法可以让Chrome在console.log写入中输出时间戳(如Firefox一样)。)

Or is prepending new Date().getTime() the only option?(或者是预先添加new Date().getTime()是唯一的选择吗?)   ask by UpTheCreek translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
254 views
Welcome To Ask or Share your Answers For Others

1 Answer

In Chrome, there is the option is Console Settings (Developer Tools -> Console -> Settings [upper-right corner] ) named "Show timestamps" which is exactly what I needed.(在Chrome中,有一个选项是控制台设置(开发人员工具 - >控制台 - >设置[右上角]),名为“显示时间戳”,这正是我所需要的。)

I've just found it.(我刚发现它。)

No other dirty hacks needed that destroys placeholders and erases place in the code where the messages was logged from.(没有其他脏的黑客需要破坏占位符并删除记录消息的代码中的位置。)

Update for Chrome 68+(Chrome 68+更新)

The "Show timestamps" setting has been moved to the Preferences pane of the "DevTools settings", found in the upper-right corner of the DevTools drawer:(“显示时间戳”设置已移至“DevTools设置”的“首选项”窗格,该窗格位于DevTools抽屉的右上角:)

在此输入图像描述


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...