36 lines
548 B
C++
36 lines
548 B
C++
|
|
#ifndef SYSTEM_LOG_H
|
|
#define SYSTEM_LOG_H
|
|
|
|
#include <string>
|
|
#include <stdarg.h>
|
|
|
|
namespace sp {
|
|
|
|
class Log
|
|
{
|
|
public :
|
|
enum Type {
|
|
T_INFO = 0,
|
|
T_WARNING = 1 << 0,
|
|
T_CRITICAL = 1 << 1,
|
|
T_ERROR = 1 << 2,
|
|
T_DEBUG = 1 << 3
|
|
};
|
|
|
|
static void info(const char *message, ...);
|
|
|
|
static void warn(const char *message, ...);
|
|
|
|
static int error(const char *message, ...);
|
|
|
|
static void debug(const char *message, ...);
|
|
|
|
private :
|
|
|
|
static void writeln(Type type, const char *fmt, va_list args);
|
|
};
|
|
|
|
} // namespace sp
|
|
|
|
#endif /* SYSTEM_LOG_H */
|