diff options
-rw-r--r-- | icetray/icetray/logger.cpp | 6 | ||||
-rw-r--r-- | icetray/icetray/logger.h | 2 | ||||
-rw-r--r-- | icetray/unittests/testIceTrayLogger.cpp | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/icetray/icetray/logger.cpp b/icetray/icetray/logger.cpp index 5ee4937..6afe4d8 100644 --- a/icetray/icetray/logger.cpp +++ b/icetray/icetray/logger.cpp @@ -20,6 +20,12 @@ namespace IceTray { { } + const std::string & + LoggerBase::getDomain() const + { + return domain; + } + Logger::Logger(const std::string & domain) : LoggerBase(domain) { } void diff --git a/icetray/icetray/logger.h b/icetray/icetray/logger.h index 123b760..339f7eb 100644 --- a/icetray/icetray/logger.h +++ b/icetray/icetray/logger.h @@ -24,6 +24,8 @@ namespace IceTray { LoggerBase(const std::string & domain); ~LoggerBase(); + const std::string & getDomain() const; + protected: friend class LogManager; mutable boost::shared_mutex _lock; diff --git a/icetray/unittests/testIceTrayLogger.cpp b/icetray/unittests/testIceTrayLogger.cpp index dfd5ae2..e7eb0fc 100644 --- a/icetray/unittests/testIceTrayLogger.cpp +++ b/icetray/unittests/testIceTrayLogger.cpp @@ -277,6 +277,7 @@ BOOST_AUTO_TEST_CASE( getLogger ) this->start("test", ic, {}); auto logger = LOGMANAGER()->getLogger("test.domain"); BOOST_REQUIRE(logger); + BOOST_REQUIRE_EQUAL("test.domain", logger->getDomain()); ic->destroy(); } |