Small enhancement: unit tests work also with verbosity >0 now.

This commit is contained in:
Matthias Koefferlein 2020-02-27 01:29:10 +01:00
parent a46cd305c6
commit 25d1a65b21
2 changed files with 11 additions and 0 deletions

View File

@ -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)

View File

@ -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;
};
/**