From 8bbeee11734d3ba8e2cf15d19cb3c302f8bfdbf2 Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:51:18 +0100 Subject: core: Add clang-tidy (#8664) This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright. --- src/debug/Log.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/debug/Log.cpp') diff --git a/src/debug/Log.cpp b/src/debug/Log.cpp index 5a314833..1563628c 100644 --- a/src/debug/Log.cpp +++ b/src/debug/Log.cpp @@ -18,7 +18,7 @@ void Debug::close() { logOfs.close(); } -void Debug::log(LogLevel level, std::string str) { +void Debug::log(eLogLevel level, std::string str) { if (level == TRACE && !trace) return; @@ -26,6 +26,7 @@ void Debug::log(LogLevel level, std::string str) { return; std::string coloredStr = str; + //NOLINTBEGIN switch (level) { case LOG: str = "[LOG] " + str; @@ -53,13 +54,14 @@ void Debug::log(LogLevel level, std::string str) { break; default: break; } + //NOLINTEND rollingLog += str + "\n"; if (rollingLog.size() > ROLLING_LOG_SIZE) rollingLog = rollingLog.substr(rollingLog.size() - ROLLING_LOG_SIZE); - if (RollingLogFollow::Get().IsRunning()) - RollingLogFollow::Get().AddLog(str); + if (SRollingLogFollow::get().isRunning()) + SRollingLogFollow::get().addLog(str); if (!disableLogs || !**disableLogs) { // log to a file -- cgit v1.2.3