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

Add a logging option for unformatted strings.

This commit is contained in:
Sandu Liviu Catalin 2020-09-06 23:54:44 +03:00
parent 67f514c77c
commit 78c2003797
2 changed files with 18 additions and 0 deletions

View File

@ -405,6 +405,19 @@ void Logger::Proccess(Uint8 level, bool sub)
} }
} }
// ------------------------------------------------------------------------------------------------
void Logger::Send(Uint8 level, bool sub, CCStr msg, size_t len)
{
// Is this level even allowed?
if ((m_ConsoleLevels & level) || (m_LogFileLevels & level))
{
// Generate the message in the buffer
m_Buffer.Write(0, msg, static_cast< Buffer::SzType >(len));
// Process the message in the buffer
Proccess(level, sub);
}
}
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void Logger::Send(Uint8 level, bool sub, CCStr fmt, va_list args) void Logger::Send(Uint8 level, bool sub, CCStr fmt, va_list args)
{ {

View File

@ -295,6 +295,11 @@ public:
*/ */
void BindCb(Uint8 level, Function & func); void BindCb(Uint8 level, Function & func);
/* --------------------------------------------------------------------------------------------
* Send a log message.
*/
void Send(Uint8 level, bool sub, CCStr msg, size_t len);
/* -------------------------------------------------------------------------------------------- /* --------------------------------------------------------------------------------------------
* Send a log message. * Send a log message.
*/ */