1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 00:37:15 +01:00

Add an extra method to the logger.

This commit is contained in:
Sandu Liviu Catalin 2022-06-23 21:07:44 +03:00
parent a1a71ee031
commit b87e68b9fc
2 changed files with 20 additions and 0 deletions

View File

@ -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)
{

View File

@ -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.
*/