summaryrefslogtreecommitdiff
path: root/inc/logger.h
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-05 14:17:45 -0500
committerbd <bdunahu@operationnull.com>2025-03-05 14:17:45 -0500
commitdb158de830e4fd4ab20ef5d357e24147c7a9281d (patch)
treea00ae7890a5b8eba91f81ac84d20a5ee0c5be0d6 /inc/logger.h
parentb4d1e8248400015f2fd0c4b0f04cf33dc867e9cd (diff)
constructors + method declarations for cache, dram, reponse, storage
Diffstat (limited to 'inc/logger.h')
-rw-r--r--inc/logger.h31
1 files changed, 23 insertions, 8 deletions
diff --git a/inc/logger.h b/inc/logger.h
index 5ecdc7e..005e518 100644
--- a/inc/logger.h
+++ b/inc/logger.h
@@ -9,17 +9,32 @@ enum LogLevel { DEBUG, INFO, WARNING, ERROR, CRITICAL };
class Logger
{
public:
- Logger(const string &);
- ~Logger();
+ /**
+ * Constructor.
+ * @param The file name to log to.
+ * @return A new logger object.
+ */
+ Logger(const string &);
+ ~Logger();
- void setLevel(LogLevel);
- void log(LogLevel, const string &);
+ /**
+ * Set the log level.
+ * @param the log level to set to.
+ */
+ void setLevel(LogLevel);
+ /**
+ * Log a message at a certain log level.
+ * @param The level to log this message. If the level is lower than the
+ * level set by `setLevel`, then the message is not logged.
+ * @param The message to log.
+ */
+ void log(LogLevel, const string &);
private:
- LogLevel level = INFO;
- ofstream logFile;
- string levelToString(LogLevel);
- int levelToInt(LogLevel);
+ LogLevel level = INFO;
+ ofstream logFile;
+ string levelToString(LogLevel);
+ int levelToInt(LogLevel);
};
#endif /* LOGGER_H_INCLUDED */