![]() Registered Member ![]()
|
Hi,
I'm developing plasmoid now. To see debug messages from my plasmoid, i ran my plasmoid using plasmoidviewer from konsole. But i have problem when i put my plasmoid to panel. To debug in this circumstance, i have to 'kquitapp plasma' then run again from konsole. And i feel this is not the right way. Below are my questions: 1. Is there any OutputDebugString equivalent in KDE or in linux? 2. Can we capture the output of kDebug from other application? 3. What is the best practice when debugging plasma, especially if it put in panel? Thanks |
![]() Administrator ![]()
|
What exactly does "OutputDebugString" do? You could use KNotification to produce a dialog with some debugging information, if it just shows a dialog with some information.
I do not believe it is possible to capture the output of stderr / stdout from another application, which is what kWarning() and kDebug() output to respectively. You could also use QDBus in your Plasmoid to retrieve information from it, by placing your debugging messages in a QStringList, then adding a scriptable method to retrieve it, which would give the desired effect.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
1. yes, syslog() function should give you something. you can use tail -f /var/log/syslog at any new konsole to see the output. 2. inside other application, you can use popen() to open your testing application, then you can capture stdout of your testing application. 3. I use syslog() exclusively and I think it is best. The only problem: syslog() exists only in Linux, Windows does not have it.
Last edited by pansz on Wed Apr 22, 2009 1:52 am, edited 1 time in total.
|
![]() Registered Member ![]()
|
I think you may write your debug info into a file if you are sure that you won't have debug code in your release version.
grissiom, proud to be a member of KDE forums since 2008-Oct.
|
![]() KDE Developer ![]()
|
I think in the case of an application started from within the session environment, e.g. through the application start menu, at least some output ends up in $HOME/.xsession-errors Additionally, output going through KDE's logging framework can be redirected to a file, syslog, etc. See the kdebugrc file, usually installed at the same location as all other global KDE configs and working like any other KDE config, e.g. a local version in $KDEHOME/share/config will override the global one. Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Thanks for sharing.
I think syslog and tail are what i need now. Inside kdebugrc there is option to redirect the output of kDebug. Below are excerpt from kdebugrc.
Since i'm using python to develop my plasma, it seem i cannot use kdebugrc yet. Because kDebug not exist (as far as i know) at current pykde. For anyone using c++ you can use these area code 1204 for plasma, 1209 for libplasma |
Registered users: Bing [Bot], Evergrowing, Google [Bot]