Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Wrong log severity

Post Reply
fneumann
Posts: 9
Joined: Thu Jan 21, 2021 4:02 pm

Wrong log severity

Post 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.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Wrong log severity

Post 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
fneumann
Posts: 9
Joined: Thu Jan 21, 2021 4:02 pm

Re: Wrong log severity

Post 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?
Last edited by fneumann on Mon Sep 12, 2022 7:24 am, edited 1 time in total.
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Wrong log severity

Post by salvadordf »

Please download CEF4Delphi again.

I just added CEF_LOG_SEVERITY_VERBOSE and CEF_LOG_SEVERITY_FATAL.
Post Reply