diff options
author | bd <bdunahu@operationnull.com> | 2025-03-02 13:37:53 -0500 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-02 13:37:53 -0500 |
commit | a9af4fd3243e470ff33d50968f998bf78c152717 (patch) | |
tree | b9815d43d79b631939cd531512b470829ba16436 /inc/logger.h | |
parent | a81e74ecfc73e27cceba863b8c780ebde51a8d47 (diff) |
Added logger class, tests, arg parsing and cleanup
Diffstat (limited to 'inc/logger.h')
-rw-r--r-- | inc/logger.h | 25 |
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 */ |