aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utilities/Logger.hpp
diff options
context:
space:
mode:
authorMax Kusatz <max@trialserver.de>2020-08-22 14:08:46 +0200
committerMax Kusatz <max@trialserver.de>2020-08-22 14:08:46 +0200
commit598218e9e1d6e97b7793b0cff2c0d50cab879fa4 (patch)
treeb0c80ca9c038195f4f473a34cb99d0c01479676a /src/Utilities/Logger.hpp
parent537a243882f49cd95b304ecf283de950440fd66a (diff)
downloadn_core-598218e9e1d6e97b7793b0cff2c0d50cab879fa4.tar.gz
n_core-598218e9e1d6e97b7793b0cff2c0d50cab879fa4.zip
Mensa working sort of with JSON
Diffstat (limited to 'src/Utilities/Logger.hpp')
-rw-r--r--src/Utilities/Logger.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Utilities/Logger.hpp b/src/Utilities/Logger.hpp
new file mode 100644
index 0000000..f319d93
--- /dev/null
+++ b/src/Utilities/Logger.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <string>
+#include <iostream>
+
+
+#include "Utilities.hpp"
+
+using std::string;
+using std::cout;
+using std::endl;
+
+#define logWarn(x) Logger::Log(x, Logger::LogLevel::lWARN)
+#define logDebug(x) Logger::Log(x, Logger::LogLevel::lDEBUG)
+#define logError(x) Logger::Log(x, Logger::LogLevel::lERROR)
+
+#define logStatus(x) Logger::Log(x, Logger::LogLevel::lSTATUS)
+
+#define log(x) logI(x)
+#define logI(x) Logger::Log(x, Logger::LogLevel::lINFO)
+
+class Logger {
+public:
+ enum class LogLevel {
+ lSTATUS, // general bot status messages, everything it logs o it's own
+ lDEBUG, // messages logged for development purposes
+ lINFO, // messages logged on certain events (eg. command executed)
+ lWARN,
+ lERROR
+ };
+
+ static void Log(const string& msg, LogLevel logLevel);
+ //static void Log(const TelegramMessage& message, LogLevel logLevel);
+
+private:
+ static void Print(const string& msg);
+};
+