Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Ideas | Propositions Global logger for Cairo debugging
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] Global logger for Cairo debugging
jesuisbenjamin English 6 jesuisbenjamin [Read]
17 August 2011 à 13:25

jesuisbenjamin, Saturday 13 August 2011 à 12:54


Subscription date : 28 October 2009
Messages : 415
Hey,

If it isn't already there, would it not be an idea to have a "logger" script that could be imported and toggled on and off for debugging?

So suppose I develop my applet, instead of using "print 'something went wrong', I would import a CDlogger and I could use CDlogger.log('something went wrong'). If toggled on CD outputs this neatly and consistently in Terminal and all applets happily communicate trough that.

Log output should show something like:

[date, time][core][info][loaded me-mennu applet]
[date, time][me-menu][critical][something's really wrong here!]

etc.

Does it make sense?

fabounet, Tuesday 16 August 2011 à 16:12


Subscription date : 30 November 2007
Messages : 17118
in C, the macro cd_warning and cie prints the source file, so then you can filter the output with a sed (see the post in Tricks and Hints)
so i suppose you could do this in Python too (print "toto: blabla", and then cairo-dock | sed -n "/toto/p")

jesuisbenjamin, Tuesday 16 August 2011 à 19:17


Subscription date : 28 October 2009
Messages : 415
I'm not sure we're talking about the same thing here

fabounet, Wednesday 17 August 2011 à 12:42


Subscription date : 30 November 2007
Messages : 17118
in the C API, you have for instance:
cd_warning ("toto")
--> file:line:warning toto

so I think it's what you wanted?
and then you can filter the output of the dock with a sed

now in Python there is no such function, but I guess you can use a custom print func, or maybe if you want to make a log class, we can integrate it in the Applet class.

jesuisbenjamin, Wednesday 17 August 2011 à 13:03


Subscription date : 28 October 2009
Messages : 415
I can't read C really, but it looks like it's what I mean.

I mean I can make my own logger class, which I could switch on or off from the configuration. I was just thinking that having a centralised means to print out a log would be more handy. Is that what you mean with "integrate it in the Applet class"?

fabounet, Wednesday 17 August 2011 à 13:08


Subscription date : 30 November 2007
Messages : 17118
yep, I think Eduardo made such a log class in one of its applet (Translator or Quote maybe), I don't remember well how it was done and how you activate it or not.

jesuisbenjamin, Wednesday 17 August 2011 à 13:25


Subscription date : 28 October 2009
Messages : 415
OK i will look at his code.

Ideas | Propositions

Subjects Author Language Messages Last message
[Locked] Global logger for Cairo debugging
jesuisbenjamin English 6 jesuisbenjamin [Read]
17 August 2011 à 13:25


Glx-Dock / Cairo-Dock List of forums Ideas | Propositions Global logger for Cairo debugging Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.