summaryrefslogtreecommitdiff
path: root/src/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-09-03 12:01:34 +0200
committerCarl Hetherington <cth@carlh.net>2020-09-21 21:57:18 +0200
commit08db8ff8a9875fe98acfd4746af293dfcc1087c2 (patch)
treeed20730e877f00c48cd42b3061db9cc2ae8194ce /src/util.cc
parent1a79bdd8329d5a6b9c3e95b428b7bb6b72572d12 (diff)
Add ASDCPErrorSuspender to hide errors from asdcplib where we expect them.
Diffstat (limited to 'src/util.cc')
-rw-r--r--src/util.cc17
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;
+}
+
+