aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utilities/Logger.hpp
diff options
context:
space:
mode:
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);
+};
+