diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-11-26 01:22:06 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-11-26 01:22:06 +0000 |
| commit | b1aae1f32e72cd96768d6134ef62fd4b45a9bd54 (patch) | |
| tree | 5fde83efa2e96ec58a85688168dfd439fc4aa363 | |
| parent | e2e5928f1056cfc555a87060592aaf20fcdbcf4f (diff) | |
Don't access Config from the static creation of dcpomatic_log.
| -rw-r--r-- | src/lib/file_log.cc | 8 | ||||
| -rw-r--r-- | src/lib/file_log.h | 3 | ||||
| -rw-r--r-- | src/lib/log.cc | 7 | ||||
| -rw-r--r-- | src/lib/log.h | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index c2a33d425..be532c10f 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -20,6 +20,7 @@ #include "file_log.h" #include "cross.h" +#include "config.h" #include <cstdio> #include <iostream> @@ -32,7 +33,14 @@ using boost::shared_ptr; FileLog::FileLog (boost::filesystem::path file) : _file (file) { + _config_connection = Config::instance()->Changed.connect (boost::bind (&FileLog::config_changed, this)); + config_changed (); +} +void +FileLog::config_changed () +{ + set_types (Config::instance()->log_types ()); } void diff --git a/src/lib/file_log.h b/src/lib/file_log.h index 6904bfd77..83f369609 100644 --- a/src/lib/file_log.h +++ b/src/lib/file_log.h @@ -29,6 +29,9 @@ public: private: void do_log (boost::shared_ptr<const LogEntry> entry); + void config_changed (); + /** filename to write to */ boost::filesystem::path _file; + boost::signals2::scoped_connection _config_connection; }; diff --git a/src/lib/log.cc b/src/lib/log.cc index e3ffd1cad..7851c133f 100644 --- a/src/lib/log.cc +++ b/src/lib/log.cc @@ -38,14 +38,7 @@ using boost::shared_ptr; Log::Log () : _types (0) { - _config_connection = Config::instance()->Changed.connect (boost::bind (&Log::config_changed, this)); - config_changed (); -} -void -Log::config_changed () -{ - set_types (Config::instance()->log_types ()); } void diff --git a/src/lib/log.h b/src/lib/log.h index 65d0229e9..b102a2d65 100644 --- a/src/lib/log.h +++ b/src/lib/log.h @@ -59,11 +59,9 @@ protected: private: virtual void do_log (boost::shared_ptr<const LogEntry> entry) = 0; - void config_changed (); /** bit-field of log types which should be put into the log (others are ignored) */ int _types; - boost::signals2::scoped_connection _config_connection; }; #endif |
