mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
New CLogger class that handles logging from Supermodel. Added so that log messages can be routed through debugger if required, rather than printed to console.
This commit is contained in:
parent
aa0c598a4c
commit
2465354ef6
45
Src/Logger.h
Normal file
45
Src/Logger.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
#ifndef INCLUDED_LOGGER_H
|
||||
#define INCLUDED_LOGGER_H
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/*
|
||||
* CLogger
|
||||
*
|
||||
* Abstract class that receives log messages from Supermodel.
|
||||
*/
|
||||
class CLogger
|
||||
{
|
||||
public:
|
||||
void DebugLog(const char *fmt, ...)
|
||||
{
|
||||
va_list vl;
|
||||
va_start(vl, fmt);
|
||||
DebugLog(fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void InfoLog(const char *fmt, ...)
|
||||
{
|
||||
va_list vl;
|
||||
va_start(vl, fmt);
|
||||
InfoLog(fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
void ErrorLog(const char *fmt, ...)
|
||||
{
|
||||
va_list vl;
|
||||
va_start(vl, fmt);
|
||||
ErrorLog(fmt, vl);
|
||||
va_end(vl);
|
||||
}
|
||||
|
||||
virtual void DebugLog(const char *fmt, va_list vl) = 0;
|
||||
|
||||
virtual void InfoLog(const char *fmt, va_list vl) = 0;
|
||||
|
||||
virtual void ErrorLog(const char *fmt, va_list vl) = 0;
|
||||
};
|
||||
|
||||
#endif // INCLUDED_LOGGER_H
|
Loading…
Reference in a new issue