Page 1 of 1

Wrong log severity

Posted: Fri Sep 09, 2022 6:48 am
by fneumann
Hi,

I am using log statements for CEF webbrowser like

Code: Select all

CefDebugLog('Called OnWebKitInitialized from SubProcess');
The second parameter in this method is the log severity and its default value is 2. According to unit uCEFConstants, a value of 2 equals LOGSEVERITY_INFO. However, the statements are reported as error in the log file:

Code: Select all

[0908/170706.866:ERROR:CEF4Delphi(1)] PID: 7096, TID: 5272, PT: Renderer - Called OnWebKitInitialized from SubProcess
Am I missing something or is this a bug?

I am using CEF4Delphi from Apr. 2022, which uses CEF 100.0.14

Thank you for your help in advance.

Re: Wrong log severity

Posted: Sat Sep 10, 2022 3:28 pm
by salvadordf
Hi,

Try using the "CEF_LOG_SEVERITY_*" constants like this :

Code: Select all

CefDebugLog('My debug text', CEF_LOG_SEVERITY_INFO);
Other possible values :

Code: Select all

  // Used in the severity parameter in the 'cef_log' function, also known as 'CefLog' in CEF4Delphi.
  CEF_LOG_SEVERITY_INFO    = 0;
  CEF_LOG_SEVERITY_WARNING = 1;
  CEF_LOG_SEVERITY_ERROR   = 2;
https://github.com/salvadordf/CEF4Delphi/blob/2364c80413408677d3327e1697eda3a3f0d6b119/source/uCEFConstants.pas#L697

Re: Wrong log severity

Posted: Mon Sep 12, 2022 5:23 am
by fneumann
This works.

So I need to use the LOGSEVERITY_* constants in order to set the log level of the logger and the CEF_LOG_SEVERITY_* constants in order to set the log level of a specific log statement. There are only CEF_LOG_SEVERITY_* constants for info, warning and error. Is it possible to make "verbose" log statements or can they only be used by the browser itself?

Re: Wrong log severity

Posted: Mon Sep 12, 2022 6:51 am
by salvadordf
Please download CEF4Delphi again.

I just added CEF_LOG_SEVERITY_VERBOSE and CEF_LOG_SEVERITY_FATAL.