Add some logging to the KDM creator.
[dcpomatic.git] / src / tools / dcpomatic_kdm.cc
index 481b0fb8b0130d936fc1c2aeb20400296e48a0a8..7a8d7cf349d532749ba69b8cfaf217d7bc232d41 100644 (file)
 #include "lib/compose.hpp"
 #include "lib/config.h"
 #include "lib/cross.h"
 #include "lib/compose.hpp"
 #include "lib/config.h"
 #include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
 #include "lib/dkdm_wrapper.h"
 #include "lib/exceptions.h"
 #include "lib/dkdm_wrapper.h"
 #include "lib/exceptions.h"
+#include "lib/file_log.h"
 #include "lib/job_manager.h"
 #include "lib/kdm_with_metadata.h"
 #include "lib/screen.h"
 #include "lib/job_manager.h"
 #include "lib/kdm_with_metadata.h"
 #include "lib/screen.h"
 #include <dcp/encrypted_kdm.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
 #include <dcp/encrypted_kdm.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
-#include "lib/warnings.h"
-DCPOMATIC_DISABLE_WARNINGS
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/filepicker.h>
 #include <wx/preferences.h>
 #include <wx/splash.h>
 #include <wx/treectrl.h>
 #include <wx/wx.h>
 #include <wx/filepicker.h>
 #include <wx/preferences.h>
 #include <wx/splash.h>
 #include <wx/treectrl.h>
 #include <wx/wx.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #ifdef __WXOSX__
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 #ifdef __WXOSX__
 #include <ApplicationServices/ApplicationServices.h>
 #endif
@@ -203,6 +205,8 @@ public:
                _export_dkdm->Bind (wxEVT_BUTTON, bind (&DOMFrame::export_dkdm_clicked, this));
 
                setup_sensitivity ();
                _export_dkdm->Bind (wxEVT_BUTTON, bind (&DOMFrame::export_dkdm_clicked, this));
 
                setup_sensitivity ();
+
+               dcpomatic_log = make_shared<FileLog>(State::write_path("kdm.log"));
        }
 
 private:
        }
 
 private:
@@ -690,7 +694,7 @@ private:
        }
 
        /* An unhandled exception has occurred inside the main event loop */
        }
 
        /* An unhandled exception has occurred inside the main event loop */
-       bool OnExceptionInMainLoop ()
+       bool OnExceptionInMainLoop () override
        {
                try {
                        throw;
        {
                try {
                        throw;