summaryrefslogtreecommitdiff
path: root/inc/logger.h
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 11:28:25 -0400
committerGitHub <noreply@github.com>2025-03-11 11:28:25 -0400
commite24e3cd4d296599b9ef1b705846b1c868148b0fd (patch)
tree25646d98b4bfcf4b9a664eabfc2651c481984c1d /inc/logger.h
parent357e7fb37caf58cdfcdf85f7553db9378ff16e0c (diff)
parentfde996690d77b81e445450671a0723f837de4eb3 (diff)
Merge pull request #23 from bdunahu/bdunahu
Memory simulator CLI function implementation
Diffstat (limited to 'inc/logger.h')
-rw-r--r--inc/logger.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/inc/logger.h b/inc/logger.h
index 7ab3051..38527c8 100644
--- a/inc/logger.h
+++ b/inc/logger.h
@@ -9,13 +9,14 @@ enum LogLevel { DEBUG, INFO, WARNING, ERROR, CRITICAL };
class Logger
{
public:
+ static Logger* getInstance();
+
+ ~Logger();
+
/**
- * Constructor.
- * @param The file name to log to.
- * @return A new logger object.
+ * Do not allow copies.
*/
- Logger(const string &);
- ~Logger();
+ Logger(const Logger& obj) = delete;
/**
* Set the log level.
@@ -31,10 +32,17 @@ class Logger
void log(LogLevel, const string &);
private:
- LogLevel level = INFO;
- ofstream logFile;
- string levelToString(LogLevel);
- int levelToInt(LogLevel);
+ /**
+ * Constructor.
+ * @param The file name to log to.
+ * @return A new logger object.
+ */
+ Logger(const string &);
+ static Logger* logger_instance;
+ static LogLevel level;
+ static ofstream logFile;
+ static string level_to_string(LogLevel);
+ static int level_to_int(LogLevel);
};
#endif /* LOGGER_H_INCLUDED */