From 08db8ff8a9875fe98acfd4746af293dfcc1087c2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 3 Sep 2020 12:01:34 +0200 Subject: Add ASDCPErrorSuspender to hide errors from asdcplib where we expect them. --- src/util.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/util.cc') 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 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; +} + + -- cgit v1.2.3