summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-02 00:41:13 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-02 00:41:13 +0100
commit16f0bebe211e18ed35b5bd32fd6dcfb915f5e02a (patch)
tree903f0f0e90ecc3ddd42dd47d4fb5657f50e314f9 /src
parentbe1440be284f244b4b9ac74b8bff5847c6237d07 (diff)
Use the configured KDM creator log file rather than a hard-coded one.
Diffstat (limited to 'src')
-rw-r--r--src/tools/dcpomatic_kdm.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index 850631d38..95d9a25b1 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -52,6 +52,7 @@
#include "lib/job_manager.h"
#include "lib/kdm_util.h"
#include "lib/kdm_with_metadata.h"
+#include "lib/null_log.h"
#include "lib/screen.h"
#include "lib/send_kdm_email_job.h"
#include "lib/util.h"
@@ -243,6 +244,7 @@ public:
/* Instantly save any config changes when using a DCP-o-matic GUI */
Config::instance()->Changed.connect(boost::bind(&DOMFrame::config_changed, this, _1));
+ setup_log();
_screens->ScreensChanged.connect(boost::bind(&DOMFrame::screens_changed, this));
_create->Bind (wxEVT_BUTTON, bind (&DOMFrame::create_kdms, this));
@@ -260,8 +262,6 @@ public:
_output->MethodChanged.connect(boost::bind(&DOMFrame::setup_sensitivity, this));
setup_sensitivity ();
-
- dcpomatic_log = make_shared<FileLog>(State::write_path("kdm.log"));
}
private:
@@ -270,8 +270,24 @@ private:
/* Instantly save any config changes when using a DCP-o-matic GUI */
Config::instance()->write();
- if (what == Config::CINEMAS_FILE) {
+ switch (what) {
+ case Config::CINEMAS_FILE:
_screens->update();
+ break;
+ case Config::KDM_DEBUG_LOG:
+ setup_log();
+ break;
+ default:
+ break;
+ }
+ }
+
+ void setup_log()
+ {
+ if (auto p = Config::instance()->kdm_debug_log_file()) {
+ dcpomatic_log = make_shared<FileLog>(*p);
+ } else {
+ dcpomatic_log = make_shared<NullLog>();
}
}