Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CEF logging functions #352

Closed
cztomczak opened this issue Apr 19, 2017 · 1 comment
Closed

Use CEF logging functions #352

cztomczak opened this issue Apr 19, 2017 · 1 comment
Milestone

Comments

@cztomczak
Copy link
Owner

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.

@cztomczak cztomczak added this to the v56 milestone Apr 19, 2017
cztomczak added a commit that referenced this issue Apr 19, 2017
Fix logging command line string for sub-processes (#351).

Remove CefExecuteProcess call in cef.Initialize. This call should
happen only in subprocess main.cpp.
@cztomczak
Copy link
Owner Author

Done in commit 896b0df. There are still two issues that need fixing in upstream CEF, reported problems on the CEF Forum and in CEF tracker:

  1. https://magpcss.org/ceforum/viewtopic.php?f=6&t=15073
  2. https://bitbucket.org/chromiumembedded/cef/issues/2154/unable-to-log-command-line-string-for-the

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant