2 #ifndef _UTILS_IntelliLog_H_
3 #define _UTILS_IntelliLog_H_
10 #include <source_location>
37 static void log(std::string level,
38 std::string_view message,
39 std::source_location
const source = std::source_location::current());
44 static void setupLoggingFile(
string fname);
56 bool isOpened =
false;
68 while (!m_mut.try_lock());
81 of.open(fname, std::ios_base::app);
105 #define INTELLI_INFO(n) IntelliLog::log("INFO",n)
111 #define INTELLI_ERROR(n) IntelliLog::log("ERROR",n)
117 #define INTELLI_WARNING(n) IntelliLog::log("WARNING",n)
123 #define INTELLI_DEBUG(n) IntelliLog::log("DEBUG",n)
The protector for concurrent log on a file.
Definition: IntelliLog.h:52
The log functions packed in class.
Definition: IntelliLog.h:28
void openLogFile(string fname)
try to open a file
Definition: IntelliLog.h:80
void unlock()
unlock this protector
Definition: IntelliLog.h:73
void appendLogFile(string msg)
try to appened something to the file, if it's opened
Definition: IntelliLog.h:91
void lock()
lock this protector
Definition: IntelliLog.h:67