博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How to enable logging
阅读量:6035 次
发布时间:2019-06-20

本文共 4027 字,大约阅读时间需要 13 分钟。

转自:https://www.chromium.org/for-testers/enable-logging

 

How to enable logging

To enable logging, launch Chrome with these command line flags:
 
--enable-logging --v=1
 
  • This will turn on full logging support (INFO, WARNING, ERROR, and VERBOSE0 for >=M9).
  • Verbose logging shows up with their own VERBOSEn label.
    • --vmodule enables verbose logging on a per module basis. Details in .
  • Most logs that used to be INFO have been moved to use verbose logging.
  • Any page load (even the new tab page) will print messages tagged with VERBOSE1; for example:
  •     [28304:28320:265508881314:VERBOSE1:chrome/browser/renderer_host/resource_dispatcher_host.cc(1098)] OnResponseStarted: chrome://newtab/
  • The output will be saved to the file chrome_debug.log in  (in the parent directory of Default/) for a release build, and in the binary build folder (e.g. out\Debug) for a debug build. On Chrome OS, messages logged by Chrome are written to files within /var/log/chrome at the login screen and to files within the log subdirectory under the logged-in user's encrypted home directory, which resides under/home/chronos.
  • With --enable-logging=stderr the output will be printed to standard error (not available on Windows)
  • This file is overwritten each time you restart chrome.
  • To enable logging from the render processes on Windows you also need the --no-sandboxcommand line flag.
     
  • To see WTF_LOG, use --blink-platform-log-channels
Note that:
  • The location of  depends on your operating system, and whether you are using Chrome vs Chromium.
  • The above document lists the path to the Default/ directory; the chrome_debug.log file we are interested in is actually one directory above this (i.e. the parent directory)
  • If the environment variable CHROME_LOG_FILE is set, Chrome will write its debug log to its specified location.  Example: Setting CHROME_LOG_FILE to "chrome_debug.log" will cause the log file to be written to the Chrome process's current working directory while setting it to "D:\chrome_debug.log" will write the log to the root of your computer's D: drive.
  • To override the log file path in a test harness that runs Chrome, use this pattern:
    #include "chrome/common/env_vars.h"
    ...
    // Set the log file path in the environment for the test browser.
    std::wstring log_file_path = ...;
    SetEnvironmentVariable(env_vars::kLogFileName, log_file_path.c_str());

How do I specify the command line flags?

See   page.

What personal information does the log file contain?

Before attaching your 
chrome_debug.log to a bug report, be aware that it can contain some personal information, such as URLs opened during that session of chrome.
 
Since the debug log is a human-readable text file, you can open it up with a text editor (notepad, vim, etc..) and review the information it contains, and erase anything you don't want the bug investigators to see.
 
The boilerplate values enclosed by brackets on each line are in the format:
 
[process_id:thread_id:ticks_in_microseconds:log_level:file_name(line_number)]

Sawbuck

Alternatively to the above, you can use the Sawbuck utility (for Windows) to view, filter and search the logs in realtime, in a handy-dandy GUI.
 
First download and install the latest version of  , launch it, then select "Configure Providers.." form the "Log" menu.
This will bring up a dialog that looks something like this:
Set the log level for Chrome, Chrome Frame, and/or the Setup program to whatever suits you, and click "OK". You can revisit this dialog at any time to increase or decrease the log verbosity.
Now select "Capture" from the "Log" menu, and you should start seeing Chrome's log messages.
Note that Sawbuck has a feature that allows you to view the call trace for each log message, which can come in handy when you're trying to home in on a particular problem.
 
Note: If you're installing Sawbuck for the first time, you may need to quit and relaunch your Chrome, as the logging transport used by Sawbuck is only enabled under an environment variable, which is set by the installer.

转载于:https://www.cnblogs.com/x_wukong/p/4844943.html

你可能感兴趣的文章
Express代理中间件问题与解决方案
查看>>
||和&&返回什么?
查看>>
linux在文件中查找指定字符串,然后根据查找结果来做进一步的处理
查看>>
在Oracle中删除所有强制性外键约束
查看>>
dhcp
查看>>
【R】R语言使用命令行参数 - [编程技巧(Program Skill)]
查看>>
经典算法题每日演练——第二题 五家共井
查看>>
存储过程中拼接的变量和点的问题
查看>>
ASP.NET那点不为人知的事(一)
查看>>
HTML 表格
查看>>
VMware 虚拟化编程(7) — VixDiskLib 虚拟磁盘库详解之三
查看>>
php 未实例化类调用方法的问题
查看>>
我对读计算机软件专业硕士的几点看法
查看>>
用JS写CSS
查看>>
TOJ4537: n阶行列式
查看>>
算法刷题笔记-stack-四则运算
查看>>
3.16
查看>>
Linux下arp用法
查看>>
表单文件上传与文件下载
查看>>
jquery 中prop()的使用方法
查看>>