From b2885e3e327d212fd47d43d0ea22f778a80794c9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 30 Nov 2020 10:46:55 +1100 Subject: [PATCH] AP_CANManager: exposed can log level --- libraries/AP_CANManager/AP_CANManager.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_CANManager/AP_CANManager.h b/libraries/AP_CANManager/AP_CANManager.h index d721993642..46b8ec44b7 100644 --- a/libraries/AP_CANManager/AP_CANManager.h +++ b/libraries/AP_CANManager/AP_CANManager.h @@ -42,7 +42,7 @@ public: return _singleton; } - enum LogLevel { + enum LogLevel : uint8_t { LOG_NONE, LOG_ERROR, LOG_WARNING, @@ -76,6 +76,12 @@ public: return nullptr; } + // returns current log level + LogLevel get_log_level(void) const + { + return LogLevel(_loglevel.get()); + } + // Method to log status and debug information for review while debugging void log_text(AP_CANManager::LogLevel loglevel, const char *tag, const char *fmt, ...);