diff --git a/src/tl/tl/tlUnitTest.cc b/src/tl/tl/tlUnitTest.cc index f0dd8c7e3..ecebd781f 100644 --- a/src/tl/tl/tlUnitTest.cc +++ b/src/tl/tl/tlUnitTest.cc @@ -146,6 +146,15 @@ CaptureChannel::CaptureChannel () tl::info.add (this, false); tl::error.add (this, false); tl::warn.add (this, false); + + // Because we don't want to capture logger messages, we switch verbosity to "silent" during capturing + m_saved_verbosity = tl::verbosity (); + tl::verbosity (0); +} + +CaptureChannel::~CaptureChannel () +{ + tl::verbosity (m_saved_verbosity); } void CaptureChannel::puts (const char *s) diff --git a/src/tl/tl/tlUnitTest.h b/src/tl/tl/tlUnitTest.h index c24fa9714..98f5eda02 100644 --- a/src/tl/tl/tlUnitTest.h +++ b/src/tl/tl/tlUnitTest.h @@ -191,6 +191,7 @@ class TL_PUBLIC CaptureChannel : public tl::Channel { public: CaptureChannel (); + ~CaptureChannel (); std::string captured_text () const { @@ -210,6 +211,7 @@ protected: private: std::ostringstream m_text; + int m_saved_verbosity; }; /**