summaryrefslogtreecommitdiff
path: root/inc/logger.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-02 20:35:40 -0500
committerGitHub <noreply@github.com>2025-03-02 20:35:40 -0500
commitb88f24b680be34b3669f33214758c76439d7b777 (patch)
treeb9815d43d79b631939cd531512b470829ba16436 /inc/logger.h
parent3fbe74a1067a6e94d62a53d4df834ff425c2c64a (diff)
parenta9af4fd3243e470ff33d50968f998bf78c152717 (diff)
Merge pull request #8 from bdunahu/bdunahu
Added logger class, tests, arg parsing and cleanup
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 */