Complete restructuring and addition of core Logging system and dhcp module

This commit is contained in:
Suraxius committed 2021-01-03 22:43:45 +01:00
1 parent 8fa965823a
commit 7fa4d1fc58
49 files changed
+3627 -193

No files matched your search

+41
View File
@@ -0,0 +1,41 @@
#ifndef LOGGER_HPP
#define LOGGER_HPP
#include <string>
#include <fstream>
#include "Core.hpp"
namespace Plains {
namespace Core {
using std::string;
using std::ofstream;
using std::streambuf;
class Logger {
public:
enum Level { DEBUG, INFO, WARN, FATAL };
Logger(Level logLevel, EventBus& eventBus);
~Logger();
void setLogLevel(Level level);
void log(Level lvl, const char* msg);
void log(Level lvl, const string& msg);
void debug(const string& msg);
void debug(const char* msg);
void info(const string& msg);
void info(const char* msg);
void warn(const string& msg);
void warn(const char* msg);
void fatal(const string& msg);
void fatal(const char* msg);
private:
EventBus& eventBus;
enum Level logLevel;
ofstream logFile;
streambuf* oldStdOut;
};
}}
#endif