Debugging output

Asked by Klaus Thoeni on 2010-12-08

Hi guys!

Can someone tell me how debugging is working in yade? I used the debug option when
compiling and the LOG-statements in the code, but I couldn't get any output
when running a simulation with yade. How can I get this output?

Thanks

Klaus

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Václav Šmilauer
Solved:
2010-12-08
Last query:
2010-12-08
Last reply:
2010-12-08
Best Václav Šmilauer (eudoxos) said : #1

Hi Klaus, have a look at https://www.yade-dem.org/sphinx/prog.html#logging . Pointing your attention to 2 things: (i) If you compile without log4cxx, there is no control over log severity etc; only messages with sevverity WARN and higher will be shown (ii) if you compile with log4cxx, by default is the default logging level WARN and higher, you need to set it to something lower to see your messages.

I see that hyperlink to yade.log is missing in the doc, it is https://www.yade-dem.org/sphinx/yade.log.html.

HTH, Václav

Anton Gladky (gladky-anton) said : #2

Hi, Klaus!

Could you not be more specific, what do you want to debug?
You are working with constitutive law and want to see values of some
variables during simulation?

If so, I would recommend you to insert into the code something like:
std:cerr<<Variable_to_output<<"\n";
And you will get all necessary information.

Personally, I use debug compilation only to get a backtrace during crash
(not just "segmentation fault").

Cheers.

Anton

On Wed, Dec 8, 2010 at 8:26 AM, Klaus Thoeni <
<email address hidden>> wrote:

> New question #137026 on Yade:
> https://answers.launchpad.net/yade/+question/137026
>
> Hi guys!
>
> Can someone tell me how debugging is working in yade? I used the debug
> option when
> compiling and the LOG-statements in the code, but I couldn't get any output
> when running a simulation with yade. How can I get this output?
>
> Thanks
>
> Klaus
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users<https://launchpad.net/%7Eyade-users>
> More help : https://help.launchpad.net/ListHelp
>

Václav Šmilauer (eudoxos) said : #3

Besides that, if you want to watch evolution of a variable at runtime, you can declare it in your class (inside YADE_CLASS_BASE_DOC_ATTRS(...) ), then looking at it in the Inspector. (You can also set Attr::noSave flag of that attribute to avoid saving it, if that is yoru concern).

For run-time debugging (setting breakpoints, executing line by line, checking values, etc.), you can use kdevelop as a gdb GUI.
It tends to be my favorite debugging method.
You can virtualy execute the whole yade line by line (though not recommended since you would visit standard libraries, boost, and so on...) It is independant on logging and doesn't need to change the code.

It's briefly explained here : https://yade-dem.org/wiki/Debugging_using_Kdevelop, but since there is nothing yade-specific, most of the documentation will be found in kdevelop documentation.

Klaus Thoeni (klaus.thoeni) said : #5

Thanks Václav Šmilauer, that solved my question.