#ifndef SYSTEM_LOG_H #define SYSTEM_LOG_H #include #include namespace sp { namespace log { class Writer; } 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 setWriter(log::Writer* writer); static void info(const char *format, ...); static void warn(const char *format, ...); static int error(const char *format, ...); static void debug(const char *format, ...); private : static void writeln(Type type, const char *fmt, va_list args); static log::Writer* _writer; }; } // namespace sp #endif /* SYSTEM_LOG_H */