debug_printf
July 04, 2010 07:36AM
Here's a debug_printf code I've been working on.

Works with USB Gecko, SD Card (.log file) USB Drive (.log file)
Just define DEBUG if you want debug_printf to do anything.

[pastie.org]

Also, you can define PRINT_DEBUG if you wish to see the debug text on screen.
Let me know if you like.
Re: debug_printf
July 05, 2010 11:35AM
Useful.
Some things:

vsnprintf does NOT add a terminating \0 at the end if the buffer is full. This could cause problems in your code.
You do the vsnprintf twice, once on line 12 and once on line 17, the one on line 17 seems wrong, as it's after the va_end.
sprintf(buf, "%s\n", buf); This might do what you want, but it does not take the length of the buffer in account. And I'm not sure why you do it at all.
Re: debug_printf
July 05, 2010 01:25PM
I know there are a few problems with it. I was just tired at the end and didn't bother going through it again.
I also believe you have to mount USB.

fmount("usb") or something like that. I'm not too familiar with fat.



Edited 1 time(s). Last edit at 07/05/2010 01:25PM by Mathew_Wi.
Re: debug_printf
July 06, 2010 12:19PM
Mathew_Wii,

take a look at our Log system. It will allow you to log into a file, gecko, web server (check our sciifii code to have an exemple) or any other source. For more types of logs, you just nedd to code a class using our provider.

If you need, i can give you an access to our web log reports (reporting services)



Edited 1 time(s). Last edit at 07/06/2010 12:20PM by arasium.
Re: debug_printf
July 06, 2010 02:55PM
Well, it's code is huge, where about?

Also, the web reporting service would be cool.
Re: debug_printf
July 07, 2010 09:11AM
You have access to our SVN repository doesn't you?

If you have a pb, contact me on MSN or mail.
Sorry, only registered users may post in this forum.

Click here to login