mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 05:00:35 +08:00
Merge pull request #2406 from mcharleb/logging-v3
Improved logging with both compile and runtime level filtering
This commit is contained in:
@@ -85,11 +85,10 @@ Device::log(const char *fmt, ...)
|
||||
|
||||
PX4_INFO("[%s] ", _name);
|
||||
va_start(ap, fmt);
|
||||
PX4_INFO( fmt, ap );
|
||||
//vprintf(fmt, ap);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
//printf("\n");
|
||||
//fflush(stdout);
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -98,14 +97,12 @@ Device::debug(const char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
if (_debug_enabled) {
|
||||
PX4_INFO("<%s> ", _name);
|
||||
//printf("<%s> ", _name);
|
||||
printf("<%s> ", _name);
|
||||
va_start(ap, fmt);
|
||||
//vprintf(fmt, ap);
|
||||
PX4_INFO(fmt, ap);
|
||||
vprintf(fmt, ap);
|
||||
va_end(ap);
|
||||
//printf("\n");
|
||||
//fflush(stdout);
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user