diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-03 12:01:34 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-21 21:57:18 +0200 |
| commit | 08db8ff8a9875fe98acfd4746af293dfcc1087c2 (patch) | |
| tree | ed20730e877f00c48cd42b3061db9cc2ae8194ce /src/util.cc | |
| parent | 1a79bdd8329d5a6b9c3e95b428b7bb6b72572d12 (diff) | |
Add ASDCPErrorSuspender to hide errors from asdcplib where we expect them.
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index f755c21e..c7d090ea 100644 --- a/src/util.cc +++ b/src/util.cc @@ -427,3 +427,20 @@ dcp::unique_string (list<string> existing, string base) DCP_ASSERT (false); } + + +ASDCPErrorSuspender::ASDCPErrorSuspender () + : _old (Kumu::DefaultLogSink()) +{ + _sink = new Kumu::EntryListLogSink(_log); + Kumu::SetDefaultLogSink (_sink); +} + + +ASDCPErrorSuspender::~ASDCPErrorSuspender () +{ + Kumu::SetDefaultLogSink (&_old); + delete _sink; +} + + |
