-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[WTF][WPE] Read the log level string from an Android system property #47352
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
base: main
Are you sure you want to change the base?
Conversation
EWS run on previous version of this PR (hash f292bc1) |
This is most useful in combination with #47339 in order to have the logging messages sent to the Android logging service. |
Source/WTF/wtf/unix/LoggingUnix.cpp
Outdated
|
||
static const char* androidLogLevelString() | ||
{ | ||
const auto* propertyInfo = __system_property_find("debug.wpewebkit.log"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove wpe
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with both approaches.
debug.webkit.log
is consistent withWEBKIT_DEBUG
as we normally use it,debug.wpewebkit.log
is possibly fairer considering we're only having active Android efforts for the WPEWebKit port
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My reason to use debug.wpewebkit.log
here was that people have been exploring how to run WebKitGTK on Android (no success yet), so at some point we may want to have also debug.webkitgtk.log
as well—we may want to allow configuring logging separately for each port, in case the GTK port is eventually made to work on Android.
Thinking about that, probably the best approach could be using something like this:
const auto* propertyInfo = __system_property_find("debug.wpewebkit.log"); | |
const auto* propertyInfo = | |
__system_property_find("debug." LOG_CHANNEL_WEBKIT_SUBSYSTEM ".log"); |
This would result in debug.WPEWebKit.log
for the WPE port, and debug.WebKitGTK.log
for the GTK one. Also, this makes the name match the “log tag” passed to __android_log_{print,vprint,write}
in #47339, making everything a bit more consistent.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the patch in this way. PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Philippe has a valid question, but I'm OK with both your approach and his suggestion. The changes look good!
f292bc1
to
e22246b
Compare
EWS run on previous version of this PR (hash e22246b) |
https://bugs.webkit.org/show_bug.cgi?id=295175 Reviewed by NOBODY (OOPS!). On Android, if the WEBKIT_DEBUG environment variable is undefined, try the debug.WPEWebKit.log system property as well to determine the value returned by WTF::logLevelString(), which is used to configure logging channels. This allows using the "setprop" command line tool to configure logging: adb shell setprop debug.WPEWebKit.log 'Scrolling,Loading'
e22246b
to
6adbad7
Compare
EWS run on current version of this PR (hash 6adbad7) |
6adbad7
6adbad7