chromium vlog 替换 log(info)
chromium vlog log 打印输出调试
在Chromium中,DVLOG(20)
是一种用于打印详细日志信息的宏。
这个宏的具体含义是在调试(Debug)版本中打印日志,而在发布(Release)版本中会被优化掉,因此在正式发布的软件中是不会产生这些日志的。
DVLOG是Debug Verbose Logging的缩写,它用于在调试模式下记录详细的日志信息。数字20表示日志的详细程度,具体的含义可能因上下文而异。通常,较低的数字表示更详细的日志。
要过滤或查看特定级别的DVLOG日志,你可以使用Chromium提供的日志过滤工具。在Chromium中,你可以使用以下命令来过滤特定级别的日志:
--vmodule=<module_name>=<verbosity_level>
在这里,<module_name>
是你感兴趣的模块名称,可以是文件名或其他标识符,<verbosity_level>
是你想要记录的详细级别。
例如,如果你想查看所有模块的DVLOG(20)日志,可以使用以下命令:
--vmodule=*=20
请注意,这些命令通常在运行Chromium的启动命令行中使用。你可以根据自己的需要调整过滤条件。
https://groups.google.com/a/chromium.org/g/chromium-dev/c/3NDNd1KzXeY?pli=1
- If everyone does this, then when you set the log level to INFO to try to debug, you're deluged with messages.
- Semantically, LOG() is supposed to be more for "messages that should always be printed", and INFO means "informative" rather than "debug" or "not printed in normal usage".
- VLOG() levels can be adjusted on a per-module basis at runtime.
- VLOG() takes an arbitrary integer value (higher numbers should be used for more verbose logging), so you can make your logging levels as granular as you wish.
Basically, if a
--vmodule pattern has a slash*, it will try to match the entire path
against it instead of just the module name. Note that this means
you'll almost always need to use wildcards for directory patterns,
e.g. --vmodule=*/chromeos/*=2,*chrome/browser/sync*=3.
* forward or back slash, but it must match your current platform --
I'll fix this in a future CL
chrome devtools面板适用说明,包括wasm c++调试
Chrome 调试技巧
vs-chromium 代码搜索
下载vs版本的代码explorer和search插件,会安装到vs2013以上版本:
http://chromium.github.io/vs-chromium/#index
下载地址:https://github.com/chromium/vs-chromium/releases/latest
启动exe文件:
cefclient.exe -url=https://www.baidu.com --enable-logging --v=1
加入断点即可。
vs-chromium-project.txt
里面写入:
[SearchableFiles.include] *
文档:http://chromium.github.io/vs-chromium/#getting-started