/** * @file logger.h * @brief cppSimpleLogger Header * @author hendrik schutter * @date 04.09.2020 */ #ifndef LOGGER_H_ #define LOGGER_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MENU_LINE_SIZE 110 // Size of menu lines #ifndef LOG_PATH // #define LOG_PATH "./test.txt" #endif #ifndef DESCRIPTION #define DESCRIPTION "Software-Name - Copyright Company 2020" // use your values here #endif #ifndef DEVICE_ID #define DEVICE_ID "Device-Name" // use your values here #endif #ifndef SOFTWARE_VERSION #define SOFTWARE_VERSION "0.1.1.8" // use your values here #endif #ifndef HARDWARE_VERSION #define HARDWARE_VERSION "7.77.9" // use your values here #endif class Logger { private: string logPath; mutex mtxLog; static bool instanceFlag; static Logger *single; string getTimestamp(); void writeLog(string s); string getMacAddress(); string padStringMenu(char cBorder, string text, uint8_t u8LineLenght); string menuLine(char cBorder, uint8_t u8LineLenght); Logger(); ~Logger(); public: void info(string s); void warning(string s); void error(string s); void newLine(); static Logger *logThis(); }; #endif // LOGGER_H_