diff --git a/module/Logger.cpp b/module/Logger.cpp index 06436bb1..a8a4147d 100644 --- a/module/Logger.cpp +++ b/module/Logger.cpp @@ -556,6 +556,21 @@ void Logger::ProcessMessage() } } +// ------------------------------------------------------------------------------------------------ +void Logger::Send(uint8_t level, bool sub, const char * msg) +{ + // Is this level even allowed? + if ((m_ConsoleLevels & level) || (m_LogFileLevels & level)) + { + // Create a new message builder + MsgPtr message(new Message(level, sub)); + // Generate the log message + message->Append(msg); + // Process the message in the buffer + PushMessage(message); + } +} + // ------------------------------------------------------------------------------------------------ void Logger::Send(uint8_t level, bool sub, const char * msg, size_t len) { diff --git a/module/Logger.hpp b/module/Logger.hpp index 5e687abc..7a820e08 100644 --- a/module/Logger.hpp +++ b/module/Logger.hpp @@ -409,6 +409,11 @@ public: */ void BindCb(uint8_t level, Function & func); + /* -------------------------------------------------------------------------------------------- + * Send a log message. + */ + void Send(uint8_t level, bool sub, const char * msg); + /* -------------------------------------------------------------------------------------------- * Send a log message. */