Merge pull request #2406 from mcharleb/logging-v3

Improved logging with both compile and runtime level filtering
This commit is contained in:
Lorenz Meier
2015-07-01 23:31:50 +02:00
6 changed files with 286 additions and 91 deletions
+7 -10
View File
@@ -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);
}
}