mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Improved logging with both compile and runtime level filtering
The device level debug will have to be removed and the debugging can be based on this new logging structure which can tell where an error (or debug output) occured whch the current implmentation cannot. The one limitation is the new macros cannot take a char* for the format parameter. It must be an actual string literal because it is concatenated with other strings. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -269,14 +269,15 @@ arming_state_transition(struct vehicle_status_s *status, ///< current vehicle s
|
||||
}
|
||||
|
||||
if (ret == TRANSITION_DENIED) {
|
||||
const char * str = "INVAL: %s - %s";
|
||||
#define WARNSTR "INVAL: %s - %s"
|
||||
/* only print to console here by default as this is too technical to be useful during operation */
|
||||
warnx(str, state_names[status->arming_state], state_names[new_arming_state]);
|
||||
warnx(WARNSTR, state_names[status->arming_state], state_names[new_arming_state]);
|
||||
|
||||
/* print to MAVLink if we didn't provide any feedback yet */
|
||||
if (!feedback_provided) {
|
||||
mavlink_log_critical(mavlink_fd, str, state_names[status->arming_state], state_names[new_arming_state]);
|
||||
mavlink_log_critical(mavlink_fd, WARNSTR, state_names[status->arming_state], state_names[new_arming_state]);
|
||||
}
|
||||
#undef WARNSTR
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user