From 7355f5613cbac9e8479bcc23efac5a78afe0570c Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Feb 2012 21:05:41 +1100 Subject: [PATCH] added SITL_debug() macro this can be used to print a message into the logs in the SITL simulator. This will be used for critical conditions. --- libraries/AP_Common/AP_Common.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_Common/AP_Common.h b/libraries/AP_Common/AP_Common.h index 0c7420b6b0..9b4e1bb6d5 100644 --- a/libraries/AP_Common/AP_Common.h +++ b/libraries/AP_Common/AP_Common.h @@ -227,5 +227,11 @@ struct Location { //@} +#ifdef DESKTOP_BUILD +// used to report serious errors in autotest +# define SITL_debug(fmt, args...) fprintf(stdout, "%s:%u " fmt, __FUNCTION__, __LINE__, ##args) +#else +# define SITL_debug(fmt, args...) +#endif #endif // _AP_COMMON_H