[Spice-devel] [PATCH spice-xpi 3/4] Switch from log4cpp to glib

David Jaša djasa at redhat.com
Mon Feb 27 08:34:12 PST 2012


Marc-André Lureau píše v Pá 24. 02. 2012 v 12:18 +0100:
> Hi
> 
> On Fri, Feb 24, 2012 at 12:10 PM, Alon Levy <alevy at redhat.com> wrote:
> >
> > I was with you until you suggested to use ldpreload. Is there an actual
> > easy way to do this to redirect error messages somewhere?
> 
> ldpreload can be useful if you want to override and use your own g_log
> handler for debugging. I don't mean it should be used as a solution,
> in production..
> 
> You can redirect with normal redirection > | etc.. I use logger to
> redirect to syslog in the spice-xpi-client scripts for example.
> 
> > So how would we make sure there is a log file for SpiceXPI?
> 
> Tbh, I think there should be *no* log file, and it should use standard
> methods instead. stderr is redirected to .xsession-errors normally,
> but you should try to reproduce an issue by setting
> G_MESSAGES_DEBUG=SpiceXPI (and other domain), starting firefox and
> redirecting output to a file.
> 

I expect that logging of remote-viewer will be controlled in the same
manner - if so, it would help debugging of any issue.

Anyway, when spice-xpi gets ported to Windows, how can one achieve
redirection of log output to the file, analogous to this:
ENV_VAR=value firefox > log_file 2>&1

?

David

> 
> >>      if (NPN_InvokeDefault(m_instance, call_on_disconnected, args, sizeof(args) / sizeof(args[0]), &void_result))
> >> -    {
> >> -        LOG_DEBUG("OnDisconnected successfuly called");
> >> -    }
> >> +        g_debug("OnDisconnected successfuly called");
> >
> > Why are you dropping the scope?
> 
> Just saving 4 empty lines. I thought about rewriting it to one line
> without condition too, ex:
> 
> g_debug("OnDisconnected: ", err != 0 ? "success" : "failed");
> 

-- 

David Jaša, RHCE

SPICE QE based in Brno
GPG Key:     22C33E24 
Fingerprint: 513A 060B D1B4 2A72 7F0D 0278 B125 CD00 22C3 3E24





More information about the Spice-devel mailing list