summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util.cc17
-rw-r--r--src/util.h15
2 files changed, 32 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;
+}
+
+
diff --git a/src/util.h b/src/util.h
index b6683265..a14d7364 100644
--- a/src/util.h
+++ b/src/util.h
@@ -41,6 +41,7 @@
#include "types.h"
#include "data.h"
#include "local_time.h"
+#include <asdcp/KM_log.h>
#include <boost/shared_ptr.hpp>
#include <boost/function.hpp>
#include <boost/filesystem.hpp>
@@ -82,6 +83,20 @@ extern bool day_less_than_or_equal (LocalTime a, LocalTime b);
extern bool day_greater_than_or_equal (LocalTime a, LocalTime b);
extern std::string unique_string (std::list<std::string> existing, std::string base);
+
+class ASDCPErrorSuspender
+{
+public:
+ ASDCPErrorSuspender();
+ ~ASDCPErrorSuspender();
+
+private:
+ Kumu::LogEntryList _log;
+ Kumu::ILogSink& _old;
+ Kumu::EntryListLogSink* _sink;
+};
+
+
}
#endif