mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 06:43:33 +08:00
POSIX: Improved logging
The warnx and warn calls map to PX4_WARN. Calls to errx or err genrtate a compile error. The px4_log.h file implements a new log format: For DEBUG and INFO: <level> <msg> For ERROR and WARN: <level> <msg> (file filepath line linenum) The verbosity can be changed by setting the macro to use either linux_log or linux_log_verbose in px4_log.h Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -205,16 +205,16 @@ BARO_SIM::transfer(const uint8_t *send, unsigned send_len,
|
||||
PX4_DEBUG("BARO_SIM measurement requested");
|
||||
}
|
||||
else if (send_len != 1 || send[0] != 0 || recv_len != 3) {
|
||||
PX4_WARN("BARO_SIM::transfer invalid param %u %u %u\n", send_len, send[0], recv_len);
|
||||
PX4_WARN("BARO_SIM::transfer invalid param %u %u %u", send_len, send[0], recv_len);
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
Simulator *sim = Simulator::getInstance();
|
||||
if (sim == NULL) {
|
||||
PX4_ERR("Error BARO_SIM::transfer no simulator \n");
|
||||
PX4_ERR("Error BARO_SIM::transfer no simulator");
|
||||
return -ENODEV;
|
||||
}
|
||||
PX4_DEBUG("BARO_SIM::transfer getting sample\n");
|
||||
PX4_DEBUG("BARO_SIM::transfer getting sample");
|
||||
sim->getBaroSample(recv, recv_len);
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user