10 #include "llvm/Support/Chrono.h"
11 #include "llvm/Support/raw_ostream.h"
23 void Logger::log(Level logLevel,
const char *fmt,
24 const llvm::formatv_object_base &message) {
28 if (logLevel < logger.logLevel)
32 const char *logLevelIndicators =
"DIE";
35 llvm::sys::TimePoint<> timestamp = std::chrono::system_clock::now();
36 std::lock_guard<std::mutex> logGuard(logger.mutex);
37 llvm::errs() << llvm::formatv(
38 "{0}[{1:%H:%M:%S.%L}] {2}\n",
39 logLevelIndicators[
static_cast<unsigned>(logLevel)], timestamp, message);
This class represents the main interface for logging, and allows for filtering logging based on diffe...
Level
The level of significance for a log message.
static void setLogLevel(Level logLevel)
Set the severity level of the logger.
Include the generated interface declarations.