diff --git a/core/base/v7/src/RDirectory.cxx b/core/base/v7/src/RDirectory.cxx index 569e17b020efc..793878e983ab6 100644 --- a/core/base/v7/src/RDirectory.cxx +++ b/core/base/v7/src/RDirectory.cxx @@ -17,7 +17,8 @@ #include -ROOT::Experimental::RLogChannel &ROOT::Experimental::IOLog() { +ROOT::RLogChannel &ROOT::Experimental::IOLog() +{ static RLogChannel sLog("ROOT.IO"); return sLog; } diff --git a/core/foundation/inc/ROOT/RLogger.hxx b/core/foundation/inc/ROOT/RLogger.hxx index a01822b06be9f..1aa022014856f 100644 --- a/core/foundation/inc/ROOT/RLogger.hxx +++ b/core/foundation/inc/ROOT/RLogger.hxx @@ -2,8 +2,6 @@ /// \ingroup Base ROOT7 /// \author Axel Naumann /// \date 2015-03-29 -/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback -/// is welcome! /************************************************************************* * Copyright (C) 1995-2020, Rene Brun and Fons Rademakers. * @@ -13,8 +11,8 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ -#ifndef ROOT7_RLogger -#define ROOT7_RLogger +#ifndef ROOT_RLogger +#define ROOT_RLogger #include #include @@ -25,7 +23,6 @@ #include namespace ROOT { -namespace Experimental { class RLogEntry; class RLogManager; @@ -317,7 +314,6 @@ inline ELogLevel RLogChannel::GetEffectiveVerbosity(const RLogManager &mgr) cons return fVerbosity; } -} // namespace Experimental } // namespace ROOT #if defined(_MSC_VER) @@ -341,28 +337,27 @@ inline ELogLevel RLogChannel::GetEffectiveVerbosity(const RLogManager &mgr) cons - Use `(condition) && RLogBuilder(...)` instead of `if (condition) RLogBuilder(...)` to prevent "ambiguous else" in invocations such as `if (something) R__LOG_DEBUG()...`. */ -#define R__LOG_TO_CHANNEL(SEVERITY, CHANNEL) \ - ((SEVERITY < ROOT::Experimental::ELogLevel::kInfo + 0) || \ - ROOT::Experimental::Internal::GetChannelOrManager(CHANNEL).GetEffectiveVerbosity( \ - ROOT::Experimental::RLogManager::Get()) >= SEVERITY) && \ - ROOT::Experimental::Detail::RLogBuilder(SEVERITY, ROOT::Experimental::Internal::GetChannelOrManager(CHANNEL), \ - __FILE__, __LINE__, R__LOG_PRETTY_FUNCTION) +#define R__LOG_TO_CHANNEL(SEVERITY, CHANNEL) \ + ((SEVERITY < ROOT::ELogLevel::kInfo + 0) || \ + ROOT::Internal::GetChannelOrManager(CHANNEL).GetEffectiveVerbosity(ROOT::RLogManager::Get()) >= SEVERITY) && \ + ROOT::Detail::RLogBuilder(SEVERITY, ROOT::Internal::GetChannelOrManager(CHANNEL), __FILE__, __LINE__, \ + R__LOG_PRETTY_FUNCTION) /// \name LogMacros /// Macros to log diagnostics. /// ~~~ {.cpp} -/// R__LOG_INFO(ROOT::Experimental::HistLog()) << "all we know is " << 42; +/// R__LOG_INFO(ROOT::HistLog()) << "all we know is " << 42; /// /// RLogScopedVerbosity verbose(kDebug + 5); /// const int decreasedInfoLevel = 5; /// R__LOG_DEBUG(ROOT::WebGUILog(), decreasedInfoLevel) << "nitty-gritty details"; /// ~~~ ///\{ -#define R__LOG_FATAL(...) R__LOG_TO_CHANNEL(ROOT::Experimental::ELogLevel::kFatal, __VA_ARGS__) -#define R__LOG_ERROR(...) R__LOG_TO_CHANNEL(ROOT::Experimental::ELogLevel::kError, __VA_ARGS__) -#define R__LOG_WARNING(...) R__LOG_TO_CHANNEL(ROOT::Experimental::ELogLevel::kWarning, __VA_ARGS__) -#define R__LOG_INFO(...) R__LOG_TO_CHANNEL(ROOT::Experimental::ELogLevel::kInfo, __VA_ARGS__) -#define R__LOG_DEBUG(DEBUGLEVEL, ...) R__LOG_TO_CHANNEL(ROOT::Experimental::ELogLevel::kDebug + DEBUGLEVEL, __VA_ARGS__) +#define R__LOG_FATAL(...) R__LOG_TO_CHANNEL(ROOT::ELogLevel::kFatal, __VA_ARGS__) +#define R__LOG_ERROR(...) R__LOG_TO_CHANNEL(ROOT::ELogLevel::kError, __VA_ARGS__) +#define R__LOG_WARNING(...) R__LOG_TO_CHANNEL(ROOT::ELogLevel::kWarning, __VA_ARGS__) +#define R__LOG_INFO(...) R__LOG_TO_CHANNEL(ROOT::ELogLevel::kInfo, __VA_ARGS__) +#define R__LOG_DEBUG(DEBUGLEVEL, ...) R__LOG_TO_CHANNEL(ROOT::ELogLevel::kDebug + DEBUGLEVEL, __VA_ARGS__) ///\} #endif diff --git a/core/foundation/src/RLogger.cxx b/core/foundation/src/RLogger.cxx index de9eb939ab8ec..239c4511d8215 100644 --- a/core/foundation/src/RLogger.cxx +++ b/core/foundation/src/RLogger.cxx @@ -22,21 +22,19 @@ #include #include -using namespace ROOT::Experimental; - // pin vtable -RLogHandler::~RLogHandler() {} +ROOT::RLogHandler::~RLogHandler() {} namespace { -class RLogHandlerDefault : public RLogHandler { +class RLogHandlerDefault : public ROOT::RLogHandler { public: // Returns false if further emission of this log entry should be suppressed. - bool Emit(const RLogEntry &entry) override; + bool Emit(const ROOT::RLogEntry &entry) override; }; -inline bool RLogHandlerDefault::Emit(const RLogEntry &entry) +inline bool RLogHandlerDefault::Emit(const ROOT::RLogEntry &entry) { - constexpr static int numLevels = static_cast(ELogLevel::kDebug) + 1; + constexpr static int numLevels = static_cast(ROOT::ELogLevel::kDebug) + 1; int cappedLevel = std::min(static_cast(entry.fLevel), numLevels - 1); constexpr static std::array sTag{ {"{unset-error-level please report}", "FATAL", "Error", "Warning", "Info", "Debug"}}; @@ -53,19 +51,19 @@ inline bool RLogHandlerDefault::Emit(const RLogEntry &entry) strm << " in " << entry.fLocation.fFuncName; static constexpr const int errorLevelOld[] = {kFatal /*unset*/, kFatal, kError, kWarning, kInfo, kInfo /*debug*/}; - (*::GetErrorHandler())(errorLevelOld[cappedLevel], entry.fLevel == ELogLevel::kFatal, strm.str().c_str(), + (*::GetErrorHandler())(errorLevelOld[cappedLevel], entry.fLevel == ROOT::ELogLevel::kFatal, strm.str().c_str(), entry.fMessage.c_str()); return true; } } // unnamed namespace -RLogManager &RLogManager::Get() +ROOT::RLogManager &ROOT::RLogManager::Get() { static RLogManager instance(std::make_unique()); return instance; } -std::unique_ptr RLogManager::Remove(RLogHandler *handler) +std::unique_ptr ROOT::RLogManager::Remove(RLogHandler *handler) { auto iter = std::find_if(fHandlers.begin(), fHandlers.end(), [&](const std::unique_ptr &handlerPtr) { return handlerPtr.get() == handler; @@ -79,7 +77,7 @@ std::unique_ptr RLogManager::Remove(RLogHandler *handler) return {}; } -bool RLogManager::Emit(const RLogEntry &entry) +bool ROOT::RLogManager::Emit(const ROOT::RLogEntry &entry) { auto channel = entry.fChannel; diff --git a/core/foundation/test/testLogger.cxx b/core/foundation/test/testLogger.cxx index d91f0d98bc8af..0c9be1260d364 100644 --- a/core/foundation/test/testLogger.cxx +++ b/core/foundation/test/testLogger.cxx @@ -7,16 +7,14 @@ #include #include -using namespace ROOT::Experimental; - struct TestLogger { - class Handler : public RLogHandler { + class Handler : public ROOT::RLogHandler { TestLogger *fLogger; public: Handler(TestLogger &logger) : fLogger(&logger) {} - bool Emit(const RLogEntry &entry) override + bool Emit(const ROOT::RLogEntry &entry) override { fLogger->fLogEntries.emplace_back(entry); // Stop emission. @@ -24,17 +22,17 @@ struct TestLogger { } }; - std::vector fLogEntries; + std::vector fLogEntries; Handler *fHandler; TestLogger() { auto uptr = std::make_unique(*this); fHandler = uptr.get(); - RLogManager::Get().PushFront(std::move(uptr)); + ROOT::RLogManager::Get().PushFront(std::move(uptr)); } - ~TestLogger() { RLogManager::Get().Remove(fHandler); } + ~TestLogger() { ROOT::RLogManager::Get().Remove(fHandler); } size_t size() const { return fLogEntries.size(); } bool empty() const { return fLogEntries.empty(); } @@ -43,10 +41,10 @@ struct TestLogger { TEST(Logger, EmittedEntry) { TestLogger testLogger; - auto prevErrors = RLogManager::Get().GetNumErrors(); - auto prevWarnings = RLogManager::Get().GetNumWarnings(); + auto prevErrors = ROOT::RLogManager::Get().GetNumErrors(); + auto prevWarnings = ROOT::RLogManager::Get().GetNumWarnings(); - RLogChannel channel("TheChannel"); + ROOT::RLogChannel channel("TheChannel"); // clang-format off R__LOG_ERROR(channel) << "The text"; auto logLine = __LINE__; @@ -54,15 +52,15 @@ TEST(Logger, EmittedEntry) // Check manager's emission EXPECT_EQ(testLogger.size(), 1); - EXPECT_EQ(RLogManager::Get().GetNumErrors(), prevErrors + 1); - EXPECT_EQ(RLogManager::Get().GetNumWarnings(), prevWarnings); + EXPECT_EQ(ROOT::RLogManager::Get().GetNumErrors(), prevErrors + 1); + EXPECT_EQ(ROOT::RLogManager::Get().GetNumWarnings(), prevWarnings); // Check emitted RLogEntry EXPECT_EQ(testLogger.fLogEntries[0].fChannel->GetName(), "TheChannel"); EXPECT_NE(testLogger.fLogEntries[0].fLocation.fFile.find("testLogger.cxx"), std::string::npos); EXPECT_NE(testLogger.fLogEntries[0].fLocation.fFuncName.find("EmittedEntry"), std::string::npos); EXPECT_EQ(testLogger.fLogEntries[0].fLocation.fLine, logLine); - EXPECT_EQ(testLogger.fLogEntries[0].fLevel, ELogLevel::kError); + EXPECT_EQ(testLogger.fLogEntries[0].fLevel, ROOT::ELogLevel::kError); EXPECT_EQ(testLogger.fLogEntries[0].fMessage, "The text"); EXPECT_TRUE(testLogger.fLogEntries[0].IsError()); EXPECT_FALSE(testLogger.fLogEntries[0].IsWarning()); @@ -72,11 +70,11 @@ TEST(Logger, RLogManagerCounts) { TestLogger testLogger; // Check diag counts of RLogManager. - auto initialWarnings = RLogManager::Get().GetNumWarnings(); - auto initialErrors = RLogManager::Get().GetNumErrors(); + auto initialWarnings = ROOT::RLogManager::Get().GetNumWarnings(); + auto initialErrors = ROOT::RLogManager::Get().GetNumErrors(); R__LOG_ERROR() << "emitted"; - EXPECT_EQ(RLogManager::Get().GetNumWarnings(), initialWarnings); - EXPECT_EQ(RLogManager::Get().GetNumErrors(), initialErrors + 1); + EXPECT_EQ(ROOT::RLogManager::Get().GetNumWarnings(), initialWarnings); + EXPECT_EQ(ROOT::RLogManager::Get().GetNumErrors(), initialErrors + 1); } TEST(Logger, RLogDiagCounter) @@ -85,7 +83,7 @@ TEST(Logger, RLogDiagCounter) R__LOG_ERROR() << "emitted"; // before RAII, should not be counted. R__LOG_ERROR() << "emitted"; // before RAII, should not be counted. // Check counter seeing what was emitted during its lifetime. - RLogScopedDiagCount counter; + ROOT::RLogScopedDiagCount counter; EXPECT_EQ(counter.GetAccumulatedWarnings(), 0); EXPECT_EQ(counter.GetAccumulatedErrors(), 0); EXPECT_FALSE(counter.HasWarningOccurred()); @@ -103,27 +101,27 @@ TEST(Logger, RLogDiagCounter) TEST(Logger, RLogScopedVerbositySuppress) { - RLogChannel channel("ABC"); + ROOT::RLogChannel channel("ABC"); - auto initialLogLevel = RLogManager::Get().GetVerbosity(); + auto initialLogLevel = ROOT::RLogManager::Get().GetVerbosity(); auto initialLogLevelABC = channel.GetVerbosity(); - EXPECT_EQ(initialLogLevel, ELogLevel::kWarning); - EXPECT_EQ(initialLogLevelABC, ELogLevel::kUnset); + EXPECT_EQ(initialLogLevel, ROOT::ELogLevel::kWarning); + EXPECT_EQ(initialLogLevelABC, ROOT::ELogLevel::kUnset); { // Test simple suppression. TestLogger testLogger; R__LOG_WARNING(channel) << "emitted"; EXPECT_EQ(testLogger.size(), 1); - RLogScopedVerbosity suppress(ELogLevel::kError); + ROOT::RLogScopedVerbosity suppress(ROOT::ELogLevel::kError); R__LOG_WARNING(channel) << "suppressed"; EXPECT_EQ(testLogger.size(), 1); } { // Test channel specific suppression given global higher verbosity. TestLogger testLogger; - RLogScopedVerbosity suppressGlobal(ELogLevel::kInfo); - RLogScopedVerbosity suppress(channel, ELogLevel::kError); + ROOT::RLogScopedVerbosity suppressGlobal(ROOT::ELogLevel::kInfo); + ROOT::RLogScopedVerbosity suppress(channel, ROOT::ELogLevel::kError); R__LOG_WARNING(channel) << "suppressed"; R__LOG_INFO(channel) << "suppressed, too"; EXPECT_TRUE(testLogger.empty()); @@ -138,16 +136,16 @@ TEST(Logger, RLogScopedVerbositySuppress) { // Check unrelated channel. TestLogger testLogger; - RLogChannel channel123("123"); - RLogScopedVerbosity suppress(channel123, ELogLevel::kFatal); + ROOT::RLogChannel channel123("123"); + ROOT::RLogScopedVerbosity suppress(channel123, ROOT::ELogLevel::kFatal); R__LOG_ERROR(channel) << "emitted"; EXPECT_EQ(testLogger.size(), 1); } { // Check global vs specific suppression. TestLogger testLogger; - RLogScopedVerbosity suppressGlobal(ELogLevel::kDebug); - RLogScopedVerbosity suppress(channel, ELogLevel::kError); + ROOT::RLogScopedVerbosity suppressGlobal(ROOT::ELogLevel::kDebug); + ROOT::RLogScopedVerbosity suppress(channel, ROOT::ELogLevel::kError); R__LOG_WARNING(channel) << "suppressed"; EXPECT_TRUE(testLogger.empty()); R__LOG_WARNING() << "emitted"; @@ -155,18 +153,18 @@ TEST(Logger, RLogScopedVerbositySuppress) } // Check that levels have returned to values before RAII. - EXPECT_EQ(RLogManager::Get().GetVerbosity(), initialLogLevel); + EXPECT_EQ(ROOT::RLogManager::Get().GetVerbosity(), initialLogLevel); EXPECT_EQ(channel.GetVerbosity(), initialLogLevelABC); } TEST(Logger, RLogScopedVerbosityVerbose) { - RLogChannel channel("ABC"); + ROOT::RLogChannel channel("ABC"); - auto initialLogLevel = RLogManager::Get().GetVerbosity(); + auto initialLogLevel = ROOT::RLogManager::Get().GetVerbosity(); auto initialLogLevelABC = channel.GetVerbosity(); - EXPECT_EQ(initialLogLevel, ELogLevel::kWarning); - EXPECT_EQ(initialLogLevelABC, ELogLevel::kUnset); + EXPECT_EQ(initialLogLevel, ROOT::ELogLevel::kWarning); + EXPECT_EQ(initialLogLevelABC, ROOT::ELogLevel::kUnset); { // Test same diag level as verbosity, in channel and global, before and after RAII. @@ -175,7 +173,7 @@ TEST(Logger, RLogScopedVerbosityVerbose) EXPECT_TRUE(testLogger.empty()); R__LOG_DEBUG(0) << "suppressed"; EXPECT_TRUE(testLogger.empty()); - RLogScopedVerbosity verbose(ELogLevel::kDebug); + ROOT::RLogScopedVerbosity verbose(ROOT::ELogLevel::kDebug); R__LOG_DEBUG(0, channel) << "emitted"; EXPECT_EQ(testLogger.size(), 1); R__LOG_DEBUG(0) << "emitted"; @@ -192,7 +190,7 @@ TEST(Logger, RLogScopedVerbosityVerbose) EXPECT_EQ(testLogger.size(), 1); R__LOG_WARNING() << "emitted"; EXPECT_EQ(testLogger.size(), 2); - RLogScopedVerbosity verbose(channel, ELogLevel::kDebug); + ROOT::RLogScopedVerbosity verbose(channel, ROOT::ELogLevel::kDebug); R__LOG_DEBUG(0, channel) << "emitted"; EXPECT_EQ(testLogger.size(), 3); R__LOG_WARNING(channel) << "emitted, too"; @@ -209,7 +207,7 @@ TEST(Logger, RLogScopedVerbosityVerbose) EXPECT_TRUE(testLogger.empty()); R__LOG_DEBUG(0, channel) << "suppressed, second"; EXPECT_TRUE(testLogger.empty()); - RLogScopedVerbosity verbose(channel, ELogLevel::kInfo); + ROOT::RLogScopedVerbosity verbose(channel, ROOT::ELogLevel::kInfo); R__LOG_INFO(channel) << "emitted"; EXPECT_EQ(testLogger.size(), 1); R__LOG_DEBUG(0, channel) << "suppressed, third"; @@ -218,8 +216,8 @@ TEST(Logger, RLogScopedVerbosityVerbose) { // Test verbosity change on other channel not influcing this one. TestLogger testLogger; - RLogChannel otherChannel("123"); - RLogScopedVerbosity verbose(otherChannel, ELogLevel::kDebug); + ROOT::RLogChannel otherChannel("123"); + ROOT::RLogScopedVerbosity verbose(otherChannel, ROOT::ELogLevel::kDebug); R__LOG_DEBUG(0, channel) << "suppressed"; EXPECT_TRUE(testLogger.empty()); R__LOG_DEBUG(0, otherChannel) << "emitted"; @@ -227,15 +225,15 @@ TEST(Logger, RLogScopedVerbosityVerbose) } // Check that levels have returned to values before RAII. - EXPECT_EQ(RLogManager::Get().GetVerbosity(), initialLogLevel); + EXPECT_EQ(ROOT::RLogManager::Get().GetVerbosity(), initialLogLevel); EXPECT_EQ(channel.GetVerbosity(), initialLogLevelABC); } TEST(Logger, ExtraVerbosityLevels) { TestLogger testLogger; - RLogChannel channel("channel"); - RLogScopedVerbosity verbose(channel, ELogLevel::kDebug + 50); + ROOT::RLogChannel channel("channel"); + ROOT::RLogScopedVerbosity verbose(channel, ROOT::ELogLevel::kDebug + 50); R__LOG_DEBUG(0, channel) << "emitted"; EXPECT_EQ(testLogger.size(), 1); @@ -254,7 +252,7 @@ TEST(Logger, ExtraVerbosityLevels) TEST(Logger, SuppressStreamEval) { TestLogger testLogger; - RLogChannel channel("channel"); + ROOT::RLogChannel channel("channel"); bool wasEvaluated = false; R__LOG_DEBUG(0, channel) << "It's debug, this should not be called!" << [&]() -> int { wasEvaluated = true; @@ -285,7 +283,7 @@ TEST(Logger, ROOTErrorHandlerDiagString) { auto prevErrorHandler = GetErrorHandler(); SetErrorHandler(testErrorHandler); - RLogChannel channel("ROOT.checkChannelName"); + ROOT::RLogChannel channel("ROOT.checkChannelName"); // clang-format off R__LOG_ERROR(channel) << "check message " << 42; auto lineNumber = __LINE__; diff --git a/geom/webviewer/inc/ROOT/RGeomData.hxx b/geom/webviewer/inc/ROOT/RGeomData.hxx index 56c32631473b6..9c9ea41e7238c 100644 --- a/geom/webviewer/inc/ROOT/RGeomData.hxx +++ b/geom/webviewer/inc/ROOT/RGeomData.hxx @@ -31,13 +31,10 @@ class TGeoVolume; namespace ROOT { class RGeomBrowserIter; - -namespace Experimental { class RLogChannel; -} // namespace Experimental /// Log channel for Geomviewer diagnostics. -Experimental::RLogChannel &RGeomLog(); +RLogChannel &RGeomLog(); /** Base description of geometry node, required only to build hierarchy */ diff --git a/geom/webviewer/src/RGeomData.cxx b/geom/webviewer/src/RGeomData.cxx index 4d85d27024ab8..abc759979844e 100644 --- a/geom/webviewer/src/RGeomData.cxx +++ b/geom/webviewer/src/RGeomData.cxx @@ -46,9 +46,9 @@ #include #include -ROOT::Experimental::RLogChannel &ROOT::RGeomLog() +ROOT::RLogChannel &ROOT::RGeomLog() { - static ROOT::Experimental::RLogChannel sLog("ROOT.Geom"); + static RLogChannel sLog("ROOT.Geom"); return sLog; } diff --git a/graf2d/gpadv7/inc/ROOT/RAttrBase.hxx b/graf2d/gpadv7/inc/ROOT/RAttrBase.hxx index eae9059484b75..717a6dd4547b2 100644 --- a/graf2d/gpadv7/inc/ROOT/RAttrBase.hxx +++ b/graf2d/gpadv7/inc/ROOT/RAttrBase.hxx @@ -14,11 +14,13 @@ #include namespace ROOT { -namespace Experimental { class RLogChannel; + +namespace Experimental { + /// Log channel for GPad diagnostics. -RLogChannel &GPadLog(); +ROOT::RLogChannel &GPadLog(); /** \class RAttrBase \ingroup GpadROOT7 diff --git a/graf2d/gpadv7/src/RAttrBase.cxx b/graf2d/gpadv7/src/RAttrBase.cxx index 61f5a6839d968..abbc86ca29a49 100644 --- a/graf2d/gpadv7/src/RAttrBase.cxx +++ b/graf2d/gpadv7/src/RAttrBase.cxx @@ -14,7 +14,7 @@ using namespace ROOT::Experimental; -RLogChannel &ROOT::Experimental::GPadLog() +ROOT::RLogChannel &ROOT::Experimental::GPadLog() { static RLogChannel sLog("ROOT.GPad"); return sLog; diff --git a/graf3d/eve7/inc/ROOT/REveTypes.hxx b/graf3d/eve7/inc/ROOT/REveTypes.hxx index 49ccf0e6ca004..c20b4fd1749d2 100644 --- a/graf3d/eve7/inc/ROOT/REveTypes.hxx +++ b/graf3d/eve7/inc/ROOT/REveTypes.hxx @@ -23,11 +23,10 @@ typedef ULong_t Pixel_t; // from GuiTypes.h class TString; namespace ROOT { +class RLogChannel; namespace Experimental { typedef unsigned int ElementId_t; -class RLogChannel; - //============================================================================== // Exceptions, string functions //============================================================================== @@ -62,7 +61,7 @@ inline std::ostream& operator <<(std::ostream &s, const REveException &e) { s << e.what(); return s; } /// Log channel for Eve diagnostics. -RLogChannel &REveLog(); +ROOT::RLogChannel &REveLog(); } // namespace Experimental } // namespace ROOT diff --git a/graf3d/eve7/src/REveManager.cxx b/graf3d/eve7/src/REveManager.cxx index 98395ea409776..12ddc9116d168 100644 --- a/graf3d/eve7/src/REveManager.cxx +++ b/graf3d/eve7/src/REveManager.cxx @@ -65,7 +65,7 @@ struct MIR_TL_Data_t } }; -thread_local std::vector gEveLogEntries; +thread_local std::vector gEveLogEntries; thread_local MIR_TL_Data_t gMIRData; /** \class REveManager diff --git a/graf3d/eve7/src/REveTypes.cxx b/graf3d/eve7/src/REveTypes.cxx index 13fb5666d6be5..3e398e9b4c226 100644 --- a/graf3d/eve7/src/REveTypes.cxx +++ b/graf3d/eve7/src/REveTypes.cxx @@ -48,8 +48,8 @@ REveException REX::operator+(const REveException &s1, const char *s2) REveException REX::operator+(const REveException &s1, ElementId_t x) { REveException r(s1); r.append(std::to_string(x)); return r; } -REX::RLogChannel &REX::REveLog() +ROOT::RLogChannel &REX::REveLog() { - static RLogChannel sLog("ROOT.Eve"); + static ROOT::RLogChannel sLog("ROOT.Eve"); return sLog; } diff --git a/gui/browsable/inc/ROOT/Browsable/RHolder.hxx b/gui/browsable/inc/ROOT/Browsable/RHolder.hxx index e97a7a7b4a4ff..65912d2ade987 100644 --- a/gui/browsable/inc/ROOT/Browsable/RHolder.hxx +++ b/gui/browsable/inc/ROOT/Browsable/RHolder.hxx @@ -15,12 +15,10 @@ namespace ROOT { -namespace Experimental { class RLogChannel; -} // namespace Experimental /// Log channel for Browsable diagnostics. -ROOT::Experimental::RLogChannel &BrowsableLog(); // implemented in RElement.cxx +ROOT::RLogChannel &BrowsableLog(); // implemented in RElement.cxx namespace Browsable { diff --git a/gui/browsable/src/RElement.cxx b/gui/browsable/src/RElement.cxx index bb9566f2ecddf..e15de311029ab 100644 --- a/gui/browsable/src/RElement.cxx +++ b/gui/browsable/src/RElement.cxx @@ -17,9 +17,9 @@ using namespace ROOT::Browsable; using namespace std::string_literals; -ROOT::Experimental::RLogChannel &ROOT::BrowsableLog() +ROOT::RLogChannel &ROOT::BrowsableLog() { - static ROOT::Experimental::RLogChannel sLog("ROOT.Browsable"); + static RLogChannel sLog("ROOT.Browsable"); return sLog; } diff --git a/gui/browserv7/inc/ROOT/RBrowserData.hxx b/gui/browserv7/inc/ROOT/RBrowserData.hxx index 8c34caa29b031..7412ef863582d 100644 --- a/gui/browserv7/inc/ROOT/RBrowserData.hxx +++ b/gui/browserv7/inc/ROOT/RBrowserData.hxx @@ -25,12 +25,10 @@ namespace ROOT { -namespace Experimental { class RLogChannel; -} // namespace Experimental /// Log channel for Browser diagnostics. -ROOT::Experimental::RLogChannel &BrowserLog(); +ROOT::RLogChannel &BrowserLog(); class RBrowserDataCleanup; diff --git a/gui/browserv7/src/RBrowserData.cxx b/gui/browserv7/src/RBrowserData.cxx index 5ded649ab85f9..0c8dac28eae9d 100644 --- a/gui/browserv7/src/RBrowserData.cxx +++ b/gui/browserv7/src/RBrowserData.cxx @@ -32,9 +32,9 @@ using namespace ROOT; using namespace std::string_literals; -ROOT::Experimental::RLogChannel &ROOT::BrowserLog() +ROOT::RLogChannel &ROOT::BrowserLog() { - static ROOT::Experimental::RLogChannel sLog("ROOT.Browser"); + static RLogChannel sLog("ROOT.Browser"); return sLog; } diff --git a/gui/canvaspainter/src/RCanvasPainter.cxx b/gui/canvaspainter/src/RCanvasPainter.cxx index 1e321181fd07a..4ee4bb7373e09 100644 --- a/gui/canvaspainter/src/RCanvasPainter.cxx +++ b/gui/canvaspainter/src/RCanvasPainter.cxx @@ -43,8 +43,9 @@ using namespace std::string_literals; using namespace ROOT::Experimental; namespace { -RLogChannel &CanvasPainerLog() { - static RLogChannel sLog("ROOT.CanvasPainer"); +ROOT::RLogChannel &CanvasPainerLog() +{ + static ROOT::RLogChannel sLog("ROOT.CanvasPainer"); return sLog; } } diff --git a/gui/cefdisplay/inc/gui_handler.h b/gui/cefdisplay/inc/gui_handler.h index 5305d17db3395..ed8ed4270c24b 100644 --- a/gui/cefdisplay/inc/gui_handler.h +++ b/gui/cefdisplay/inc/gui_handler.h @@ -21,12 +21,10 @@ #include namespace ROOT { -namespace Experimental { class RLogChannel; } -} -ROOT::Experimental::RLogChannel &CefWebDisplayLog(); +ROOT::RLogChannel &CefWebDisplayLog(); class THttpServer; diff --git a/gui/cefdisplay/src/gui_handler.cxx b/gui/cefdisplay/src/gui_handler.cxx index 273dc97a8a67a..e4940c9d443c2 100644 --- a/gui/cefdisplay/src/gui_handler.cxx +++ b/gui/cefdisplay/src/gui_handler.cxx @@ -41,10 +41,9 @@ #include "TBase64.h" #include - -ROOT::Experimental::RLogChannel &CefWebDisplayLog() +ROOT::RLogChannel &CefWebDisplayLog() { - static ROOT::Experimental::RLogChannel sChannel("ROOT.CefWebDisplay"); + static RLogChannel sChannel("ROOT.CefWebDisplay"); return sChannel; } diff --git a/gui/fitpanelv7/inc/ROOT/RFitPanelModel.hxx b/gui/fitpanelv7/inc/ROOT/RFitPanelModel.hxx index 6adc26cf5156b..88d4ebc32425a 100644 --- a/gui/fitpanelv7/inc/ROOT/RFitPanelModel.hxx +++ b/gui/fitpanelv7/inc/ROOT/RFitPanelModel.hxx @@ -26,11 +26,11 @@ class TF1; class TFitResult; namespace ROOT { +class RLogChannel; namespace Experimental { -class RLogChannel; /// Log channel for FitPanel diagnostics. -RLogChannel &FitPanelLog(); +ROOT::RLogChannel &FitPanelLog(); /** Data structure for the fit panel */ diff --git a/gui/fitpanelv7/src/RFitPanelModel.cxx b/gui/fitpanelv7/src/RFitPanelModel.cxx index 3b3d53c2d6755..36f02fa508d4d 100644 --- a/gui/fitpanelv7/src/RFitPanelModel.cxx +++ b/gui/fitpanelv7/src/RFitPanelModel.cxx @@ -19,7 +19,7 @@ #include "TFitResult.h" #include "TF1.h" -ROOT::Experimental::RLogChannel &ROOT::Experimental::FitPanelLog() +ROOT::RLogChannel &ROOT::Experimental::FitPanelLog() { static RLogChannel sLog("ROOT.FitPanel"); return sLog; diff --git a/gui/qt5webdisplay/rootwebpage.cpp b/gui/qt5webdisplay/rootwebpage.cpp index 50dc8e723eb39..01a5d2091eb5b 100644 --- a/gui/qt5webdisplay/rootwebpage.cpp +++ b/gui/qt5webdisplay/rootwebpage.cpp @@ -17,9 +17,9 @@ #include "TEnv.h" #include -ROOT::Experimental::RLogChannel &QtWebDisplayLog() +ROOT::RLogChannel &QtWebDisplayLog() { - static ROOT::Experimental::RLogChannel sChannel("ROOT.QtWebDisplay"); + static RLogChannel sChannel("ROOT.QtWebDisplay"); return sChannel; } diff --git a/gui/qt5webdisplay/rootwebpage.h b/gui/qt5webdisplay/rootwebpage.h index a4d3b2dce84b9..1fb418169a8c3 100644 --- a/gui/qt5webdisplay/rootwebpage.h +++ b/gui/qt5webdisplay/rootwebpage.h @@ -16,12 +16,10 @@ #include namespace ROOT { -namespace Experimental { class RLogChannel; } -} -ROOT::Experimental::RLogChannel &QtWebDisplayLog(); +ROOT::RLogChannel &QtWebDisplayLog(); class RootWebPage : public QWebEnginePage { Q_OBJECT diff --git a/gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx b/gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx index ff7595907d4f7..4d728c48c9264 100644 --- a/gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx +++ b/gui/webdisplay/inc/ROOT/RWebDisplayArgs.hxx @@ -20,13 +20,10 @@ class THttpServer; namespace ROOT { -namespace Experimental { class RLogChannel; -} // namespace Experimental /// Log channel for WebGUI diagnostics. -ROOT::Experimental::RLogChannel &WebGUILog(); - +ROOT::RLogChannel &WebGUILog(); class RWebWindow; @@ -106,7 +103,7 @@ public: { return !IsHeadless() && ((GetBrowserKind() == kOn) || (GetBrowserKind() == kNative) || (GetBrowserKind() == kChrome) || - (GetBrowserKind() == kEdge) || (GetBrowserKind() == kSafari) || (GetBrowserKind() == kFirefox) || + (GetBrowserKind() == kEdge) || (GetBrowserKind() == kSafari) || (GetBrowserKind() == kFirefox) || (GetBrowserKind() == kDefault) || (GetBrowserKind() == kCustom)); } diff --git a/gui/webdisplay/src/RWebDisplayArgs.cxx b/gui/webdisplay/src/RWebDisplayArgs.cxx index 4d4e58b4cadc2..306e62511261a 100644 --- a/gui/webdisplay/src/RWebDisplayArgs.cxx +++ b/gui/webdisplay/src/RWebDisplayArgs.cxx @@ -21,9 +21,9 @@ using namespace ROOT; -ROOT::Experimental::RLogChannel &ROOT::WebGUILog() +ROOT::RLogChannel &ROOT::WebGUILog() { - static ROOT::Experimental::RLogChannel sLog("ROOT.WebGUI"); + static RLogChannel sLog("ROOT.WebGUI"); return sLog; } diff --git a/hist/histv7/inc/ROOT/RHistUtils.hxx b/hist/histv7/inc/ROOT/RHistUtils.hxx index 3cc947709ff43..1092d6cfd6292 100644 --- a/hist/histv7/inc/ROOT/RHistUtils.hxx +++ b/hist/histv7/inc/ROOT/RHistUtils.hxx @@ -19,11 +19,12 @@ #include namespace ROOT { +class RLogChannel; + namespace Experimental { -class RLogChannel; /// Log channel for Hist diagnostics. -RLogChannel &HistLog(); // implemented in RAxis.cxx +ROOT::RLogChannel &HistLog(); // implemented in RAxis.cxx namespace Hist { diff --git a/hist/histv7/src/RAxis.cxx b/hist/histv7/src/RAxis.cxx index 7818be3d89fea..3b96005320804 100644 --- a/hist/histv7/src/RAxis.cxx +++ b/hist/histv7/src/RAxis.cxx @@ -22,12 +22,12 @@ #include // From RHistUtils.hxx: -ROOT::Experimental::RLogChannel &ROOT::Experimental::HistLog() { +ROOT::RLogChannel &ROOT::Experimental::HistLog() +{ static RLogChannel sLog("ROOT.Hist"); return sLog; } - ROOT::Experimental::RAxisBase::~RAxisBase() {} bool ROOT::Experimental::RAxisBase::HasSameBinningAs(const RAxisBase& other) const { diff --git a/net/davix/inc/TDavixFile.h b/net/davix/inc/TDavixFile.h index fa23bec4f0f76..1f3afdcd555b3 100644 --- a/net/davix/inc/TDavixFile.h +++ b/net/davix/inc/TDavixFile.h @@ -60,12 +60,9 @@ class TDavixFileInternal; struct Davix_fd; namespace ROOT { -namespace Experimental { class RLogChannel; -} -} - -ROOT::Experimental::RLogChannel &TDavixLogChannel(); +ROOT::RLogChannel &TDavixLogChannel(); +} // namespace ROOT class TDavixFile : public TFile { private: diff --git a/net/davix/src/TDavixFile.cxx b/net/davix/src/TDavixFile.cxx index 1dd7e49dfe2ad..643006425d398 100644 --- a/net/davix/src/TDavixFile.cxx +++ b/net/davix/src/TDavixFile.cxx @@ -81,9 +81,9 @@ static Context* davix_context_s = NULL; //////////////////////////////////////////////////////////////////////////////// -ROOT::Experimental::RLogChannel &TDavixLogChannel() +ROOT::RLogChannel &TDavixLogChannel() { - static ROOT::Experimental::RLogChannel sLog("ROOT.TDavix"); + static ROOT::RLogChannel sLog("ROOT.TDavix"); return sLog; } diff --git a/tree/dataframe/inc/ROOT/RDF/Utils.hxx b/tree/dataframe/inc/ROOT/RDF/Utils.hxx index 10313453f16aa..896139182df89 100644 --- a/tree/dataframe/inc/ROOT/RDF/Utils.hxx +++ b/tree/dataframe/inc/ROOT/RDF/Utils.hxx @@ -37,9 +37,7 @@ namespace RDF { using ColumnNames_t = std::vector; } -namespace Experimental { class RLogChannel; -} namespace RDF { class RDataSource; @@ -50,7 +48,7 @@ namespace RDF { using ROOT::RDF::ColumnNames_t; -ROOT::Experimental::RLogChannel &RDFLogChannel(); +ROOT::RLogChannel &RDFLogChannel(); // fwd decl for ColumnName2ColumnTypeName class RDefineBase; diff --git a/tree/dataframe/src/RDFHelpers.cxx b/tree/dataframe/src/RDFHelpers.cxx index 3490901b5d91f..7a8952b5d6215 100644 --- a/tree/dataframe/src/RDFHelpers.cxx +++ b/tree/dataframe/src/RDFHelpers.cxx @@ -89,16 +89,14 @@ unsigned int ROOT::RDF::RunGraphs(std::vector handles) TStopwatch sw; sw.Start(); { - const auto effectiveVerbosity = - ROOT::Experimental::Internal::GetChannelOrManager(ROOT::Detail::RDF::RDFLogChannel()) - .GetEffectiveVerbosity(ROOT::Experimental::RLogManager::Get()); - if (effectiveVerbosity >= ROOT::Experimental::ELogLevel::kDebug + 10) { + const auto effectiveVerbosity = ROOT::Internal::GetChannelOrManager(ROOT::Detail::RDF::RDFLogChannel()) + .GetEffectiveVerbosity(ROOT::RLogManager::Get()); + if (effectiveVerbosity >= ROOT::ELogLevel::kDebug + 10) { // a very high verbosity was requested, let's not silence anything uniqueLoops[0].fLoopManager->Jit(); } else { // silence logs from RLoopManager::Jit: RunGraphs does its own logging - auto silenceRDFLogs = ROOT::Experimental::RLogScopedVerbosity(ROOT::Detail::RDF::RDFLogChannel(), - ROOT::Experimental::ELogLevel::kError); + auto silenceRDFLogs = ROOT::RLogScopedVerbosity(ROOT::Detail::RDF::RDFLogChannel(), ROOT::ELogLevel::kError); uniqueLoops[0].fLoopManager->Jit(); } } diff --git a/tree/dataframe/src/RDFUtils.cxx b/tree/dataframe/src/RDFUtils.cxx index cb6f6857cc37b..0c0ff777a7fa1 100644 --- a/tree/dataframe/src/RDFUtils.cxx +++ b/tree/dataframe/src/RDFUtils.cxx @@ -34,9 +34,9 @@ using namespace ROOT::Detail::RDF; using namespace ROOT::RDF; -ROOT::Experimental::RLogChannel &ROOT::Detail::RDF::RDFLogChannel() +ROOT::RLogChannel &ROOT::Detail::RDF::RDFLogChannel() { - static ROOT::Experimental::RLogChannel c("ROOT.RDF"); + static RLogChannel c("ROOT.RDF"); return c; } diff --git a/tree/ntuple/v7/inc/ROOT/RNTupleUtil.hxx b/tree/ntuple/v7/inc/ROOT/RNTupleUtil.hxx index ac18f94b757da..d94fdb8988ba3 100644 --- a/tree/ntuple/v7/inc/ROOT/RNTupleUtil.hxx +++ b/tree/ntuple/v7/inc/ROOT/RNTupleUtil.hxx @@ -50,11 +50,12 @@ struct RNTupleCardinality { ValueType fValue; }; +class RLogChannel; + namespace Experimental { -class RLogChannel; /// Log channel for RNTuple diagnostics. -RLogChannel &NTupleLog(); +ROOT::RLogChannel &NTupleLog(); // clang-format off /** diff --git a/tree/ntuple/v7/src/RNTupleUtil.cxx b/tree/ntuple/v7/src/RNTupleUtil.cxx index b96949c3ca134..bb1a6b5b38717 100644 --- a/tree/ntuple/v7/src/RNTupleUtil.cxx +++ b/tree/ntuple/v7/src/RNTupleUtil.cxx @@ -25,7 +25,8 @@ #include #include -ROOT::Experimental::RLogChannel &ROOT::Experimental::NTupleLog() { +ROOT::RLogChannel &ROOT::Experimental::NTupleLog() +{ static RLogChannel sLog("ROOT.NTuple"); return sLog; } diff --git a/tree/ntupleutil/v7/src/RNTupleExporter.cxx b/tree/ntupleutil/v7/src/RNTupleExporter.cxx index 79ebe72845632..9b4eb475ec6f3 100644 --- a/tree/ntupleutil/v7/src/RNTupleExporter.cxx +++ b/tree/ntupleutil/v7/src/RNTupleExporter.cxx @@ -25,7 +25,7 @@ namespace ROOT::Experimental::Internal { namespace { -ROOT::Experimental::RLogChannel &RNTupleExporterLog() +ROOT::RLogChannel &RNTupleExporterLog() { static RLogChannel sLog("ROOT.RNTupleExporter"); return sLog;