include/Spectre/System/Log.h: implement a static "Log" class instead of just a function.
This commit is contained in:
parent
e10daeaaa6
commit
3b27db9435
8 changed files with 101 additions and 31 deletions
|
|
@ -2,9 +2,31 @@
|
|||
#ifndef SYSTEM_LOG_H
|
||||
#define SYSTEM_LOG_H
|
||||
|
||||
#include <string>
|
||||
#include <stdarg.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
void log(const char *fmt, ...);
|
||||
class Log
|
||||
{
|
||||
public :
|
||||
enum Type {
|
||||
T_INFO = 0,
|
||||
T_WARNING = 1 << 0,
|
||||
T_CRITICAL = 1 << 1,
|
||||
T_ERROR = 1 << 2,
|
||||
};
|
||||
|
||||
static void info(const char *message, ...);
|
||||
|
||||
static void warn(const char *message, ...);
|
||||
|
||||
static int error(const char *message, ...);
|
||||
|
||||
private :
|
||||
|
||||
static void writeln(Type type, const char *fmt, va_list args);
|
||||
};
|
||||
|
||||
} // namespace sp
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue