summaryrefslogtreecommitdiff
path: root/inc
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
commite3369aad54bce775e2951e71618eb2cbb17972f9 (patch)
treeb9815d43d79b631939cd531512b470829ba16436 /inc
parentac072708e869970f33f3523dda3051a39a9ba611 (diff)
parenta9af4fd3243e470ff33d50968f998bf78c152717 (diff)
Merge pull request #8 from bdunahu/bdunahu
Added logger class, tests, arg parsing and cleanup
Diffstat (limited to 'inc')
-rw-r--r--inc/fact.h6
-rw-r--r--inc/logger.h25
2 files changed, 25 insertions, 6 deletions
diff --git a/inc/fact.h b/inc/fact.h
deleted file mode 100644
index de1220a..0000000
--- a/inc/fact.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef FACT_H
-#define FACT_H
-
-unsigned int factorial(unsigned int);
-
-#endif
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 */