summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-11-21 23:17:00 +0000
committerCarl Hetherington <cth@carlh.net>2018-11-21 23:17:00 +0000
commitad1ef39eda58b3a919ea3b7084401a0439409ec6 (patch)
tree2bf2888a1a964f07b7dc318c7bf7dd73e1d61eb0 /src/tools
parentfe8251bb73765b459042b0fa841dae2d440487fd (diff)
Tidy and fix logging.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc2
-rw-r--r--src/tools/dcpomatic_cli.cc3
-rw-r--r--src/tools/dcpomatic_kdm.cc2
-rw-r--r--src/tools/dcpomatic_player.cc1
-rw-r--r--src/tools/dcpomatic_server.cc4
-rw-r--r--src/tools/dcpomatic_server_cli.cc8
-rw-r--r--src/tools/server_test.cc7
7 files changed, 16 insertions, 11 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 1a87a2872..bd0c40e88 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -76,6 +76,7 @@
#include "lib/audio_content.h"
#include "lib/check_content_change_job.h"
#include "lib/text_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/exceptions.h>
#include <dcp/raw_convert.h>
#include <wx/generic/aboutdlgg.h>
@@ -402,6 +403,7 @@ public:
film->set_name (path.filename().generic_string());
film->write_metadata ();
set_film (film);
+ dcpomatic_log = film->log ();
}
void load_film (boost::filesystem::path file)
diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc
index 779e0ad26..5535e6218 100644
--- a/src/tools/dcpomatic_cli.cc
+++ b/src/tools/dcpomatic_cli.cc
@@ -33,6 +33,7 @@
#include "lib/ratio.h"
#include "lib/video_content.h"
#include "lib/audio_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/version.h>
#include <boost/foreach.hpp>
#include <getopt.h>
@@ -331,6 +332,8 @@ main (int argc, char* argv[])
exit (EXIT_SUCCESS);
}
+ dcpomatic_log = film->log ();
+
ContentList content = film->content ();
for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
vector<boost::filesystem::path> paths = (*i)->paths ();
diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc
index e901d2d0c..2af57e369 100644
--- a/src/tools/dcpomatic_kdm.cc
+++ b/src/tools/dcpomatic_kdm.cc
@@ -340,7 +340,7 @@ private:
}
pair<shared_ptr<Job>, int> result = _output->make (
- screen_kdms, decrypted.content_title_text(), _timing, bind (&DOMFrame::confirm_overwrite, this, _1), shared_ptr<Log> ()
+ screen_kdms, decrypted.content_title_text(), _timing, bind (&DOMFrame::confirm_overwrite, this, _1)
);
if (result.first) {
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 7028624a8..d00129a4c 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -51,6 +51,7 @@
#include "lib/monitor_checker.h"
#include "lib/lock_file_checker.h"
#include "lib/ffmpeg_content.h"
+#include "lib/dcpomatic_log.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc
index 2b22aca7d..64bbb3049 100644
--- a/src/tools/dcpomatic_server.cc
+++ b/src/tools/dcpomatic_server.cc
@@ -27,6 +27,7 @@
#include "lib/log.h"
#include "lib/signaller.h"
#include "lib/cross.h"
+#include "lib/dcpomatic_log.h"
#include <wx/taskbar.h>
#include <wx/splash.h>
#include <wx/icon.h>
@@ -268,6 +269,7 @@ private:
}
server_log.reset (new ServerLog);
+ dcpomatic_log = server_log;
Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
Config::Warning.connect (boost::bind (&App::config_warning, this, _1));
@@ -304,7 +306,7 @@ private:
void main_thread ()
try {
- EncodeServer server (server_log, false, Config::instance()->server_encoding_threads());
+ EncodeServer server (false, Config::instance()->server_encoding_threads());
server.run ();
} catch (...) {
store_current ();
diff --git a/src/tools/dcpomatic_server_cli.cc b/src/tools/dcpomatic_server_cli.cc
index 6dca8064c..d1bee2dcc 100644
--- a/src/tools/dcpomatic_server_cli.cc
+++ b/src/tools/dcpomatic_server_cli.cc
@@ -28,6 +28,7 @@
#include "lib/null_log.h"
#include "lib/version.h"
#include "lib/encode_server.h"
+#include "lib/dcpomatic_log.h"
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/algorithm/string.hpp>
@@ -104,14 +105,11 @@ main (int argc, char* argv[])
}
}
- shared_ptr<Log> log;
if (write_log) {
- log.reset (new FileLog ("dcpomatic_server_cli.log"));
- } else {
- log.reset (new NullLog);
+ dcpomatic_log.reset (new FileLog("dcpomatic_server_cli.log"));
}
- EncodeServer server (log, verbose, num_threads);
+ EncodeServer server (verbose, num_threads);
try {
server.run ();
diff --git a/src/tools/server_test.cc b/src/tools/server_test.cc
index 3d16038c1..1dc6fa6ca 100644
--- a/src/tools/server_test.cc
+++ b/src/tools/server_test.cc
@@ -47,21 +47,20 @@ using dcp::Data;
static shared_ptr<Film> film;
static EncodeServerDescription* server;
-static shared_ptr<FileLog> log_ (new FileLog ("servomatictest.log"));
static int frame_count = 0;
void
process_video (shared_ptr<PlayerVideo> pvf)
{
- shared_ptr<DCPVideo> local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
- shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K, log_));
+ shared_ptr<DCPVideo> local (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K));
+ shared_ptr<DCPVideo> remote (new DCPVideo (pvf, frame_count, film->video_frame_rate(), 250000000, RESOLUTION_2K));
cout << "Frame " << frame_count << ": ";
cout.flush ();
++frame_count;
- Data local_encoded = local->encode_locally (boost::bind (&Log::dcp_log, log_.get(), _1, _2));
+ Data local_encoded = local->encode_locally ();
Data remote_encoded;
string remote_error;