[Goodies-dev] plugin development and logging information

Jannis Pohlmann jannis at xfce.org
Wed Feb 13 12:23:28 CET 2008


Am Wed, 13 Feb 2008 08:41:19 +0100
schrieb lidiriel <lidiriel at coriolys.org>:

> Hello the list,
> 
> how to get a logging/debug information in a plugin ?
> I would like use a loggging system for check a internal plugin data.
> Like fprintf(stderr," .... ");
> or a xfce macro if exist like DEBUG("my info to log");
> I thank the stderr was redirect into .xsession-error but i am not
> sure. If someone have a tutorial, a link or a short example, this was
> very cool !

I think Brian wrote about it on spuriousinterrupt.org some time, but
I'm unable to find it right now. The trick is to run your plugin with
valgrind by tweaking your .desktop file in 

  /usr/share/xfce4/panel-plugins/

Either use

  X-XFCE-Exec=valgrind /usr/libexec/xfce4/panel-plugins/your-plugin.desktop

or use wrapper script (put somewhere else)

  X-XFCE-Exec=/path/to/the/script

and have it look like

  #!/bin/sh
  
  valgrind <parameters> /path/to/your-plugin.desktop &> /tmp/plugin.out

Something like that should do (nice for backtraces by the way). For
simple debugging just put some g_debug/g_message/g_whatever calls into
the code and run the panel from a terminal. If I remember correctly then
all output is forwarded to the panels stdout/stderr.

  - Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/goodies-dev/attachments/20080213/19b5aac4/attachment.pgp>


More information about the Goodies-dev mailing list