mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 05:23:33 +08:00
px4_log: remove __px4_log_level_current
- there is no way to change it at runtime - it was implemented wrong (<= comparison disabled the PANIC log level)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
|
||||
__EXPORT int __px4_log_level_current = PX4_LOG_LEVEL_AT_RUN_TIME;
|
||||
|
||||
__EXPORT const char *__px4_log_level_str[_PX4_LOG_LEVEL_PANIC + 1] = { "INFO", "DEBUG", "WARN", "ERROR", "PANIC" };
|
||||
__EXPORT const char *__px4_log_level_color[_PX4_LOG_LEVEL_PANIC + 1] =
|
||||
@@ -33,18 +32,16 @@ void px4_backtrace()
|
||||
|
||||
__EXPORT void px4_log_modulename(int level, const char *moduleName, const char *fmt, ...)
|
||||
{
|
||||
if (level <= __px4_log_level_current) {
|
||||
PX4_LOG_COLOR_START
|
||||
printf(__px4__log_level_fmt __px4__log_level_arg(level));
|
||||
PX4_LOG_COLOR_MODULE
|
||||
printf(__px4__log_modulename_pfmt, moduleName);
|
||||
PX4_LOG_COLOR_MESSAGE
|
||||
va_list argptr;
|
||||
va_start(argptr, fmt);
|
||||
vprintf(fmt, argptr);
|
||||
va_end(argptr);
|
||||
PX4_LOG_COLOR_END
|
||||
printf("\n");
|
||||
}
|
||||
PX4_LOG_COLOR_START
|
||||
printf(__px4__log_level_fmt __px4__log_level_arg(level));
|
||||
PX4_LOG_COLOR_MODULE
|
||||
printf(__px4__log_modulename_pfmt, moduleName);
|
||||
PX4_LOG_COLOR_MESSAGE
|
||||
va_list argptr;
|
||||
va_start(argptr, fmt);
|
||||
vprintf(fmt, argptr);
|
||||
va_end(argptr);
|
||||
PX4_LOG_COLOR_END
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user