10 #include "llvm/Support/Chrono.h"
11 #include "llvm/Support/ManagedStatic.h"
12 #include "llvm/Support/raw_ostream.h"
24 void Logger::log(Level logLevel,
const char *fmt,
25 const llvm::formatv_object_base &message) {
29 if (logLevel < logger.logLevel)
33 const char *logLevelIndicators =
"DIE";
36 llvm::sys::TimePoint<> timestamp = std::chrono::system_clock::now();
37 std::lock_guard<std::mutex> logGuard(logger.mutex);
38 llvm::errs() << llvm::formatv(
39 "{0}[{1:%H:%M:%S.%L}] {2}\n",
40 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.