stderr from a module?
Chris Mahoney (1684) 2165 posts |
When I’m working on normal apps and don’t feel like fighting with DDT I find it easiest to print debugging information to stderr and then launch the app with “2> errfile”. Is it possible to do this with a module? If not, what’s the easiest way to record debug information? I could save to a hardcoded file but I’m just wondering whether there’s a better way. |
Colin (478) 2433 posts |
I used to do it like that but to my shame I only recently gave Reporter a chance after knowing about it for a long time and it’s much easier getting debug output in real time. It can also be used in modules. These days I generally use either Reporter, DaDebug or Serial output so I have a one file debug library which you are welcome to try. All output options work from a module or app. It’s just 1 header file – instructions for use are in the file. |
Rick Murray (539) 13840 posts |
There may be restrictions on what you can do, since modules open up the issue of reentrancy. TickerV, ServiceCall handlers, etc – if you touch a file you may end up with “FileCore in use” because that part of the module code is not called when it is “safe” but rather in response to something while other things are running. You are very likely to be interrupting a SWI call and the like… |
Chris Mahoney (1684) 2165 posts |
Now that you mention it, I remember seeing references to Reporter scattered around the forums. I’ve also found DADebug. Thanks for the tips; I’ll have a play. |
Colin Ferris (399) 1814 posts |
Is ‘DADebug’ available for download – with some examples? |
Colin (478) 2433 posts |
It’s compiled from the rom sources. I’ve now included a compiled copy with the debug library I mentioned earlier – and for some reason I put the debug file in a c directory when it should have been in a h directory. I’ve also included an example of using the lib file with DADebug – see the readme file |