Bug 41528

Summary: Provide logging interface
Product: Spice Reporter: David Jaša <jasa.david>
Component: spice-gtkAssignee: Spice Bug List <spice-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description David Jaša 2011-10-06 08:24:50 UTC
Provide interface for client applications so the app can log events in similar way as spicec does to .spicec/spicec.log
Comment 1 Marc-Andre Lureau 2011-10-06 10:55:59 UTC
My opinion on this is that the lib shouldn't log itself in files. This doesn't seem like a good practice.

Instead I suggest it uses "SPICE_DEBUG=1 spice-client | grep whatever we need | logger -t spice-client" to log to syslog.

The wrapper script will be spice-xpi-client, provided with the client package.
Comment 2 Christophe Fergeau 2011-10-06 13:33:42 UTC
Yep, but the lib needs to provide logging data to the application if we want it to write to syslog or wherever :) This is what this bug is about since on IRC I wasn't sure if the spice gtk widget already provides this information or not.
Comment 3 Marc-Andre Lureau 2011-10-06 13:45:56 UTC
What do we want to log that is not in SPICE_DEBUG ?

We could have SPICE_DEBUG levels to filter things, instead of grepping. Until now, I didn't see the need, but why not?
Comment 4 Marc-Andre Lureau 2012-01-05 05:55:20 UTC
until we have very good reason to log into files directly from the lib, I'll close this bug.
Comment 5 David Jaša 2012-01-06 07:43:18 UTC
(In reply to comment #4)
> until we have very good reason to log into files directly from the lib, I'll
> close this bug.

As Christophe pointed out in #c2, this bug does _NOT_ request logging anywhere from the lib.

It actually requests to leave the decision what to log and how to log to an author of actual client application and just provide infractructure that allows exactly that.
Comment 6 Marc-Andre Lureau 2012-01-06 08:57:51 UTC
the infrastucture for logging is provided by glib.

They can redirect spice-gtk messages at their will. Anything I am missing?
Comment 7 David Jaša 2012-01-06 19:48:43 UTC
(In reply to comment #6)
> the infrastucture for logging is provided by glib.
> 
> They can redirect spice-gtk messages at their will. Anything I am missing?

OK, so does that mean that app that uses spice-gtk can e.g. take message about insertion of smartcard that will be forwarded to user via libnotivy event but ignore everything else? If so, I'm fine with RESOLVED/FIXED.

(If the feature is present but not reported/verified, then notabug is a kind of confusing, fixed would make a whole lot of more sense to me.)
Comment 8 Marc-Andre Lureau 2012-01-07 04:39:45 UTC
(In reply to comment #7)
> OK, so does that mean that app that uses spice-gtk can e.g. take message about
> insertion of smartcard that will be forwarded to user via libnotivy event but
> ignore everything else? If so, I'm fine with RESOLVED/FIXED.

Even better, there is a signal for that event: SpiceSmartcardManager::card-inserted.

otherwise, it is a simple as having a log handler that filter messages like this:

if (domain == "GSpice" && strstr (message, "smartcard: card-inserted"))
  log notify (domain, level, message)

It would be interesting to introduce more domains, so that you don't need to filter by message, for example:

GSpiceSmartcard, GSpiceDisplay, GSpiceAudio etc.. 

But I am not fond of this idea, since it wouldn't be terribly helpful (to understand what's going on, you'd need several domains), and will probably match the filename that you can already filter on. Furthermore, the amount of messages isn't that big, so it seems better to me to just log it all from GSpice.

But if there is a need, we could do that.
Comment 9 Marc-Andre Lureau 2013-04-10 15:31:38 UTC
this is moved to GNOME / GLib

https://bugzilla.gnome.org/show_bug.cgi?id=692979

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.