// // Created by epagris on 2022.05.03.. // #ifndef WFR_APP_LOGGER_H #define WFR_APP_LOGGER_H #include #include class Logger { public: static constexpr int LOG_FD_DEF = STDOUT_FILENO; // default log file descriptor private: static bool mLogEn; // enable logging static int mLogFD; // file descriptor for logging static bool mCloseOnStop; // close file when stopping logging private: Logger() = default; // constr. public: static void startLogging(int fd = STDOUT_FILENO); // start logging on given file descriptor static void startLogging(const std::string &filename); // start logging using a filename static void stopLogging(); // stop logging // logging functions static void log(const std::string &str); static void logLine(const std::string &str); }; #endif //WFR_APP_LOGGER_H