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