This is a simple logging library that is made to colorize errors and info based on their levels. It'll allow you to store the information with their levels and time occurance inside a file with a custome name.
Note
NEW UPDATE: The setSaveLogFileStatus function name changed to enableFileLogging
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.enableFileLogging(true); //start logging into the file
logger.Log(LogLevel::ERROR, "This is an error log"); //default filename is Log.log
logger.enableFileLogging(false); //Stop logging into the file
}
int main() {
//make an instance
SyncLogging logger;
logger.setFileName("Logging"); // add your custom name for log file
logger.enableFileLogging(true); //start logging into the file
logger.Log(LogLevel::ERROR, "This is an error log");
logger.enableFileLogging(false); //Stop logging into the file
}
enum class LogLevel {
DEBUG,
INFO,
WARNING,
ERROR,
CRITICAL,
FATAL
};