#pragma once #include #include namespace LogMe { enum logging_level { DEBUG, INFO, WARN, ERROR, CRITICAL }; class Logger { public: Logger(logging_level level, const std::string& log_file) : level_{ level } { output_stream_.open(log_file); } Logger(logging_level level) : level_{ level } {} ~Logger() { if (output_stream_.is_open()) { output_stream_.close(); } } void set_debug_level(logging_level level); void log(logging_level level, const std::string& msg); void debug(const std::string& msg); void info(const std::string& msg); void warn(const std::string& msg); void critical(const std::string& msg); void error(const std::string& msg); private: logging_level level_; std::ofstream output_stream_; }; } // namespace LogMe