From 71a942c24b4c4f803a4cf6a968b67b960adce09c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 16 Sep 2019 10:55:26 +0200 Subject: [PATCH] Log: rename isShutdown to isShutdownCalled Class members that differ only in case are not great. Change-Id: I2e54bf9b6da7e4e15e03389000a6ff86e98c16a6 --- common/Log.cpp | 2 +- common/Log.hpp | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/common/Log.cpp b/common/Log.cpp index c94b382a2297..0153eff14e67 100644 --- a/common/Log.cpp +++ b/common/Log.cpp @@ -227,7 +227,7 @@ namespace Log } #endif - bool isShutdown() + bool isShutdownCalled() { return IsShutdown; } diff --git a/common/Log.hpp b/common/Log.hpp index 6690c01bc1d7..6bf85129e27d 100644 --- a/common/Log.hpp +++ b/common/Log.hpp @@ -59,8 +59,8 @@ namespace Log #if !MOBILEAPP /// Shutdown and release the logging system. void shutdown(); - /// Was shutdown() called? - bool isShutdown(); + /// Was static shutdown() called? If so, producing more logs should be avoided. + bool isShutdownCalled(); #endif char* prefix(char* buffer, std::size_t len, const char* level); @@ -291,7 +291,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.trace()) \ + if (!Log::isShutdownCalled() && log_.trace()) \ { \ LOG_BODY_(log_, TRACE, "TRC", X, true); \ } \ @@ -301,7 +301,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.trace()) \ + if (!Log::isShutdownCalled() && log_.trace()) \ { \ LOG_BODY_(log_, TRACE, "TRC", X, false);\ } \ @@ -311,7 +311,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.debug()) \ + if (!Log::isShutdownCalled() && log_.debug()) \ { \ LOG_BODY_(log_, DEBUG, "DBG", X, true); \ } \ @@ -321,7 +321,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.information()) \ + if (!Log::isShutdownCalled() && log_.information()) \ { \ LOG_BODY_(log_, INFORMATION, "INF", X, true); \ } \ @@ -331,7 +331,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.warning()) \ + if (!Log::isShutdownCalled() && log_.warning()) \ { \ LOG_BODY_(log_, WARNING, "WRN", X, true); \ } \ @@ -341,7 +341,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.error()) \ + if (!Log::isShutdownCalled() && log_.error()) \ { \ LOG_BODY_(log_, ERROR, "ERR", X, true); \ } \ @@ -351,7 +351,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.error()) \ + if (!Log::isShutdownCalled() && log_.error()) \ { \ LOG_BODY_(log_, ERROR, "ERR", X << " (" << Util::symbolicErrno(errno) << ": " << std::strerror(errno) << ")", true); \ } \ @@ -362,7 +362,7 @@ namespace Log { \ std::cerr << X << std::endl; \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.fatal()) \ + if (!Log::isShutdownCalled() && log_.fatal()) \ { \ LOG_BODY_(log_, FATAL, "FTL", X, true); \ } \ @@ -372,7 +372,7 @@ namespace Log do \ { \ auto &log_ = Log::logger(); \ - if (!Log::isShutdown() && log_.error()) \ + if (!Log::isShutdownCalled() && log_.error()) \ { \ LOG_BODY_(log_, FATAL, "FTL", X << " (" << Util::symbolicErrno(errno) << ": " << std::strerror(errno) << ")", true); \ } \