1
0
Fork 0

include/Spectre/System/Log.h: implement a static "Log" class instead of just a function.

This commit is contained in:
Henrik Hautakoski 2019-11-10 14:56:56 +01:00
parent e10daeaaa6
commit 3b27db9435
No known key found for this signature in database
GPG key ID: 96765B12FEAC4745
8 changed files with 101 additions and 31 deletions

View file

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