Bug 110452

Summary: Add LOG_DEBUG for printing messages without log channel
Product: WebKit Reporter: Gyuyoung Kim <gyuyoung.kim>
Component: Web Template FrameworkAssignee: Gyuyoung Kim <gyuyoung.kim>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, benjamin, cmarcelo, laszlo.gombos, ojan.autocc, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch benjamin: review-

Gyuyoung Kim
Reported 2013-02-21 03:27:13 PST
LOG_VERBOSE can't print log messages when we need to print debugging log without a log channel. Beside LOG_ERROR is also not proper for the debugging log. So, I'd like to suggest to use LOG_DEBUG. It will help to print debugging message without a log channel.
Attachments
Patch (2.87 KB, patch)
2013-02-21 03:48 PST, Gyuyoung Kim
benjamin: review-
Gyuyoung Kim
Comment 1 2013-02-21 03:48:53 PST
Alexey Proskuryakov
Comment 2 2013-02-21 09:53:15 PST
Can you please give an example of where you'd like to use this?
Benjamin Poulain
Comment 3 2013-02-21 12:24:56 PST
Comment on attachment 189501 [details] Patch Someone tries to add this every few months. :( Please define what is a "Debug Log". There was a thread on webkit-dev about debug logging facilities (thread: "Easing printf based debugging in WebKit with an helper"). There were some agreement on what it should do and how it should look like.
Benjamin Poulain
Comment 4 2013-02-21 12:28:29 PST
*** This bug has been marked as a duplicate of bug 90823 ***
Gyuyoung Kim
Comment 5 2013-02-21 18:35:31 PST
(In reply to comment #2) > Can you please give an example of where you'd like to use this? I was considering to replace EFL specific debug log with common WebKit log facilities. For example, EINA_LOG_DBG, EINA_LOG_CRIT and so on. But, we need to set additional an environment variable in order to use it. I and my co-worker thought this is not efficient for debugging. Because EFL port also uses WebKit LOG() as well. So, if LOG() macro supports debug log, I think we're able to replace all EFL specific logs with WebKit's thing. For example, as below, EINA_LOG_DBG("failed to load plugin, unload it without shutting it down."); => LOG_DEBUG("failed to load plugin, unload it without shutting it down."); EINA_LOG_ERR("failed to load plugin, unload it without shutting it down."); => LOG_ERROR("failed to load plugin, unload it without shutting it down."); Then, we can see this log as well as LOG_ERROR's message on debug build. Benjamin, thank you for noticing it, I will monitor Bug 90823.
Laszlo Gombos
Comment 6 2013-02-21 19:45:02 PST
(In reply to comment #5) > (In reply to comment #2) > > Can you please give an example of where you'd like to use this? > > EINA_LOG_DBG("failed to load plugin, unload it without shutting it down."); > => LOG_DEBUG("failed to load plugin, unload it without shutting it down."); Would WTFLogAlways() work here ?
Gyuyoung Kim
Comment 7 2013-02-21 19:54:21 PST
(In reply to comment #6) > (In reply to comment #5) > > (In reply to comment #2) > > > Can you please give an example of where you'd like to use this? > > > > > EINA_LOG_DBG("failed to load plugin, unload it without shutting it down."); > > => LOG_DEBUG("failed to load plugin, unload it without shutting it down."); > > Would WTFLogAlways() work here ? It works on release build as well. Beside it always shows messages regardless of build mode or env variable. It looks Apple folks wanted to use it. As you know, LOG() can only work on mostly ports's debug mode. So, I wasn't sure if we can make LOG wrapper for it, and replace EINA_LOG_XXX macro with it.
Gyuyoung Kim
Comment 8 2013-02-21 20:10:42 PST
(In reply to comment #7) > (In reply to comment #6) > > (In reply to comment #5) > > > (In reply to comment #2) > > > > Can you please give an example of where you'd like to use this? > > > > > > > > EINA_LOG_DBG("failed to load plugin, unload it without shutting it down."); > > > => LOG_DEBUG("failed to load plugin, unload it without shutting it down."); > > > > Would WTFLogAlways() work here ? > > It works on release build as well. Beside it always shows messages regardless of build mode or env variable. It looks Apple folks wanted to use it. As you know, LOG() can only work on mostly ports's debug mode. So, I wasn't sure if we can make LOG wrapper for it, and replace EINA_LOG_XXX macro with it. BTW, is it possible to add EFL specific log macro based on WTFLogAlways() ? In GStreamerUtilities.h case, for example, it redefines LOG_VERBOSE as below, #define LOG_MEDIA_MESSAGE(...) do { \ GST_DEBUG(__VA_ARGS__); \ LOG_VERBOSE(Media, __VA_ARGS__); } while (0) For example, #if !LOG_DISABLED #define LOG_EFL_DEBUG() WTFLogAlways() #endif
Alexey Proskuryakov
Comment 9 2013-02-21 20:19:44 PST
The issue with cross-platform LOG_DEBUG is that many people just don't want debug logging that they didn't enable. It tends to make real error messages less visible. I'm not sure why you want that in EFL code. In any case, it seems like you currently have a working solution with EINA_LOG_DBG.
Gyuyoung Kim
Comment 10 2013-02-21 20:30:46 PST
(In reply to comment #9) > The issue with cross-platform LOG_DEBUG is that many people just don't want debug logging that they didn't enable. It tends to make real error messages less visible. > > I'm not sure why you want that in EFL code. In any case, it seems like you currently have a working solution with EINA_LOG_DBG. I agree with your comment. LOG_DEBUG may show blooming logs for someone. Thanks.
Note You need to log in before you can comment on or make changes to this bug.