我已经将google-chrome配置为将调试日志转储到chrome_debug.loguser-data-dir中。
这对于调试我们一些比较棘手的浏览器问题很方便。但是,我遇到了一些超时问题,因此我试图弄清楚日志行上的前缀是什么意思。由于此日志来自今天(6月11日),因此我猜“ 0611”部分是今天的日期。我猜在那之后的“ / 053512”是以秒为单位的时间戳吗?
[296:296:0611/053512:VERBOSE1:password_store_factory.cc(276)] Password storage detected desktop environment: (unknown)
[296:296:0611/053512:WARNING:password_store_factory.cc(322)] Using basic (unencrypted) store for password storage. See http://code.google.com/p/chromium/wiki/LinuxPasswordStorage for more information about password storage options.
[296:296:0611/053512:VERBOSE1:render_process_host_impl.cc(687)] Mojo Channel is enabled on host
[6:6:0611/053512:VERBOSE1:sandbox_linux.cc(68)] Activated seccomp-bpf sandbox for process type: renderer.
[6:6:0611/053512:VERBOSE1:child_thread_impl.cc(321)] Mojo is enabled on child
[6:6:0611/053527:INFO:child_thread_impl.cc(725)] ChildThreadImpl::EnsureConnected()
[296:318:0611/053611:VERBOSE1:chrome_browser_main_posix.cc(216)] Handling shutdown for signal 15.
Run Code Online (Sandbox Code Playgroud)
甚至更好的是指向生成前缀的代码所在的指针。由于我怀疑它会更改(我在Debian Linux上运行chrome v43.0.x)。
该文档说:
每行中用括号括起来的样板值的格式为:
[process_id:thread_id:ticks_in_microseconds:log_level:file_name(line_number)]
但是“ 0611/053512”显然不是“ ticks_in_microseconds”。
Chrome 的base/logging.cc中LogMessage::Init定义了 chrome_debug.log 中日志前缀的内容。时间戳部分定义为:
struct tm* tm_time = &local_time;
stream_ << std::setfill('0')
<< std::setw(2) << 1 + tm_time->tm_mon
<< std::setw(2) << tm_time->tm_mday
<< '/'
<< std::setw(2) << tm_time->tm_hour
<< std::setw(2) << tm_time->tm_min
<< std::setw(2) << tm_time->tm_sec
<< ':';
Run Code Online (Sandbox Code Playgroud)
这就是:mmDD/HHMMSS(月、日、/、小时、分钟、秒)。
因此,两个时间戳“0611/053512”和“0611/053611”之间的差异不是99秒,而是59秒。
| 归档时间: |
|
| 查看次数: |
517 次 |
| 最近记录: |