Bug 27899

Summary: Use more debug levels
Product: Telepathy Reporter: Jonny Lamb <jonny.lamb>
Component: tp-glibAssignee: Jonny Lamb <jonny.lamb>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: git master   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Jonny Lamb 2010-04-29 08:46:38 UTC
This is the tp-glib version of bug 27889. See my branch.
Comment 1 Simon McVittie 2010-04-29 09:09:02 UTC
>  #undef DEBUG
> +#define ERROR(format, ...) \

You mean "#undef ERROR" here.

With that change, consider it to have been approved. Thanks!
Comment 2 Jonny Lamb 2010-04-29 09:12:48 UTC
Great, merged.
Comment 3 Simon McVittie 2010-04-30 08:26:41 UTC
Actually, this had some fairly major problems, which I only spotted while converting telepathy-glib to use it:

* When you ./configure --disable-debug, DEBUG messages aren't logged. However, messages of every higher level should be logged, regardless (if only for their side-effects, like g_error killing the process).

* It's not obvious to the compiler that ERROR doesn't return.

See my branch. Until these changes go in, we shouldn't use WARNING() etc.
Comment 4 Jonny Lamb 2010-05-01 00:14:49 UTC
Yeah, looks alright. I'm guessing you can use sed correctly so didn't check 8b96c0066 very thoroughly.
Comment 5 Simon McVittie 2010-05-03 03:22:22 UTC
Thanks, merged for 0.11.5.

(In reply to comment #4)
> Yeah, looks alright. I'm guessing you can use sed correctly so didn't check
> 8b96c0066 very thoroughly.

I didn't just sed this - some of the calls already used G_STRFUNC, which is now redundant. I re-checked the patch before merging, though, and I think the compiler would catch most failure modes in those format strings anyway.

Now that _tp_log() is always compiled, I wonder whether we should change the logic further, at least for cases where there's a debug sender, to:

* if --enable-debug:
  - DEBUG() always goes to the debug sender
  - if the debug sender's Enabled property is true, if (DEBUGGING) blocks
    are entered regardless of debug flags
  - if the appropriate debug flag is enabled, if (DEBUGGING) blocks are
    entered, and DEBUG() also goes to the default log handler
* else (--disable-debug):
  - DEBUG() aren't compiled
  - if (DEBUGGING) becomes if (0) and isn't entered
  - everything else behaves as normal

Otherwise, enabling the debug sender turns on Gabble debug in Empathy or ceiling-cat, but does not turn on telepathy-glib debug :-(
Comment 6 GitLab Migration User 2019-12-03 20:02:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/29.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.