在做WebRTC时,有时需要查看Chrome底层的Log。
我使用的是Chrome Canary,在如下位置
/Applications/Google Chrome Canary.app/Contents/MacOS
执行如下命令便可以打开更详细的Log
cd /Applications/Google\ Chrome\ Canary.app/Contents/MacOS
./Google\ Chrome\ Canary --enable-logging --v=1
日志的则在另一个位置,参见如下命令:
cd ~/Library/Application\ Support/Google/
ls
cd Chrome\ Canary
ls
tail -f chrome_debug.log
然后启动WebRTC测试,果然可以看到很多有用的信息。
从Stack Overflow上查到更多的位置:
- On Windows
The default location is in the local app data folder :
[Chrome] %LOCALAPPDATA%\Google\Chrome\User Data
[Chromium] %LOCALAPPDATA%\Chromium\User Data
- On MacOSX
In the Application Support folder :
[Chrome] ~/Library/Application Support/Google/Chrome
[Chromium] ~/Library/Application Support/Chromium
3. On Linux
In the ~/.config folder :
```sh
[Chrome Stable] ~/.config/google-chrome
[Chrome Beta] ~/.config/google-chrome-beta
[Chrome Dev] ~/.config/google-chrome-unstable
[Chromium] ~/.config/chromium
也可以改变日志目录(用户数据目录):
[Windows] chrome.exe --user-data-dir=c:\foo
[Linux] google-chrome --user-data-dir=/path/to/foo
[Windows] chromium-browser --user-data-dir=c:\foo
[Linux] chromium-browser --user-data-dir=/path/to/foo
参见:
祝玩得开心。