31 lines
529 B
C++
31 lines
529 B
C++
#ifndef OG_LOG_H_
|
|
#define OG_LOG_H_
|
|
|
|
#include "pc/commcode.h"
|
|
#include <cstdio>
|
|
#include <string>
|
|
|
|
class Logger {
|
|
public:
|
|
static Logger* getInstance();
|
|
|
|
void debug(const std::string&) const;
|
|
void info(const std::string&) const;
|
|
void warn(const std::string&) const;
|
|
void error(const std::string&) const;
|
|
void fatal(const std::string&) const;
|
|
void setLogLeval(LogLevel v);
|
|
|
|
private:
|
|
Logger();
|
|
static Logger* const instance_;
|
|
|
|
void _log(LogLevel v, const std::string&) const;
|
|
|
|
LogLevel filter;
|
|
};
|
|
|
|
Logger* Log();
|
|
|
|
#endif
|