summaryrefslogtreecommitdiff
path: root/inc/logger.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/logger.h')
-rw-r--r--inc/logger.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/inc/logger.h b/inc/logger.h
new file mode 100644
index 0000000..5ecdc7e
--- /dev/null
+++ b/inc/logger.h
@@ -0,0 +1,25 @@
+#ifndef LOGGER_H
+#define LOGGER_H
+#include <fstream>
+#include <sstream>
+using namespace std;
+
+enum LogLevel { DEBUG, INFO, WARNING, ERROR, CRITICAL };
+
+class Logger
+{
+ public:
+ Logger(const string &);
+ ~Logger();
+
+ void setLevel(LogLevel);
+ void log(LogLevel, const string &);
+
+ private:
+ LogLevel level = INFO;
+ ofstream logFile;
+ string levelToString(LogLevel);
+ int levelToInt(LogLevel);
+};
+
+#endif /* LOGGER_H_INCLUDED */