Description
Use CEF logging functions instead of custom ones so that both CEF and CEF Python use the same mechanism. Currently CEF Python uses separate functions with logs written to the same file as CEF. This is causing issues on Windows 10 when opening debug.log file for writing. There is a big delay, some issue while acquiring file lock. This was reported in Issue #277 (ApplicationSettings.debug option causing GUI stuttering when calling Python functions from JS).
There is one downside of using CEF logging. CEF logging is initialized only after CefInitialize() was called, thus log_severity and log_file are not applied till that moment. Thus these initial log messages are not written to debug.log file:
[0419/144733.981879:INFO:cef_log.cpp(8)] [Browser process] Initialize() called
[0419/144733.982130:INFO:cef_log.cpp(8)] [Browser process] CefInitialize()
[0419/144733.982393:INFO:cef_log.cpp(8)] [Browser process]
App_OnBeforeCommandLineProcessing_BrowserProcess()
[0419/144733.982427:INFO:cefpython_app.cpp(79)] [Browser process] Command line
string for the browser process: --browser-subprocess-path=/usr/local/lib/python2.7/dist-
packages/cefpython3/subprocess --no-sandbox --lang=en-US --log-
file=/home/cz/github/cefpython/build/debug.log --log-severity=info --resources-dir-
path=/usr/local/lib/python2.7/dist-packages/cefpython3 --locales-dir-path=/usr/local/lib/
python2.7/dist-packages/cefpython3/locales --remote-debugging-port=51884
These messaged will be printed in console, however they won't be available in log file.