summaryrefslogtreecommitdiff
path: root/Log.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Log.hh')
-rw-r--r--Log.hh30
1 files changed, 1 insertions, 29 deletions
diff --git a/Log.hh b/Log.hh
index 0656fa6..9edd03f 100644
--- a/Log.hh
+++ b/Log.hh
@@ -4,11 +4,6 @@
#include <cstdarg>
#include <cstdio>
-#include <llvm/Support/FormatVariadic.h>
-#include <llvm/Support/WithColor.h>
-
-#include "Context.hh"
-
namespace pcc {
enum LogLevel { PCC_DEBUG, PCC_INFO, PCC_WARNING, PCC_ERROR };
@@ -18,30 +13,7 @@ LogLevel GetLogLevel();
void SetExecutableName(const char* name);
const char* GetExecutableName();
-template <typename... Args>
-void Log(LogLevel level, const char* format, Args&&... args) {
- if (level < GetLogLevel()) {
- return;
- }
- auto msg = llvm::formatv(format, std::forward<Args>(args)...);
- const char* name = GetExecutableName();
- switch (level) {
- case PCC_DEBUG:
- llvm::WithColor::remark(llvm::errs(), name) << msg << '\n';
- break;
- case PCC_INFO:
- llvm::WithColor::note(llvm::errs(), name) << msg << '\n';
- break;
- case PCC_WARNING:
- llvm::WithColor::warning(llvm::errs(), name) << msg << '\n';
- break;
- case PCC_ERROR:
- llvm::WithColor::error(llvm::errs(), name) << msg << '\n';
- break;
- default:
- break;
- }
-}
+void Log(LogLevel level, const char* format, ...);
} // namespace pcc
#endif