This is a simple logger that I made to simplify and also store the debugging information that might be critical in the future. You can use this library whether for only console logging or save those logging into custom file
Note
NEW UPDATE: The structure has been changed, read the doc for the usage of loggingsystem
Note
NOTE: Thread Safety is added
#include "SyncLogging.h"
int main(){
SyncLogging logger;
}
#include "SyncLogging.h"
int main(){
SyncLogging logger;
logger.Log(LogLevel::ERROR, "This is an error log")
}
int main() {
//make an instance
SyncLogging logger;
logger.setSaveLogFileStatus(true); //start logging into the file
logger.Log(LogLevel::ERROR, "This is an error log"); //default filename is Log.log
logger.setSaveLogFileStatus(false); //Stop logging into the file
}
int main() {
//make an instance
SyncLogging logger;
logger.setFileName("Logging"); // add your custom name for log file
logger.setSaveLogFileStatus(true); //start logging into the file
logger.Log(LogLevel::ERROR, "This is an error log");
logger.setSaveLogFileStatus(false); //Stop logging into the file
}
enum class LogLevel {
DEBUG,
INFO,
WARNING,
ERROR,
CRITICAL,
FATAL
};