summaryrefslogtreecommitdiff
path: root/src
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
parentfe8251bb73765b459042b0fa841dae2d440487fd (diff)
Tidy and fix logging.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_decoder.cc3
-rw-r--r--src/lib/butler.cc24
-rw-r--r--src/lib/butler.h3
-rw-r--r--src/lib/cinema_kdms.cc25
-rw-r--r--src/lib/cinema_kdms.h3
-rw-r--r--src/lib/content_factory.cc3
-rw-r--r--src/lib/cross.cc7
-rw-r--r--src/lib/cross.h2
-rw-r--r--src/lib/dcp.cc3
-rw-r--r--src/lib/dcp_content.cc3
-rw-r--r--src/lib/dcp_video.cc16
-rw-r--r--src/lib/dcp_video.h8
-rw-r--r--src/lib/encode_server.cc15
-rw-r--r--src/lib/encode_server.h3
-rw-r--r--src/lib/environment_info.cc3
-rw-r--r--src/lib/ffmpeg.cc13
-rw-r--r--src/lib/ffmpeg_content.cc2
-rw-r--r--src/lib/ffmpeg_decoder.cc5
-rw-r--r--src/lib/ffmpeg_encoder.cc10
-rw-r--r--src/lib/ffmpeg_encoder.h1
-rw-r--r--src/lib/ffmpeg_file_encoder.cc2
-rw-r--r--src/lib/ffmpeg_file_encoder.h2
-rw-r--r--src/lib/film.cc6
-rw-r--r--src/lib/j2k_encoder.cc18
-rw-r--r--src/lib/job.cc4
-rw-r--r--src/lib/log.cc2
-rw-r--r--src/lib/log.h2
-rw-r--r--src/lib/player.cc2
-rw-r--r--src/lib/reel_writer.cc6
-rw-r--r--src/lib/send_kdm_email_job.cc7
-rw-r--r--src/lib/send_kdm_email_job.h4
-rw-r--r--src/lib/transcode_job.cc5
-rw-r--r--src/lib/upload_job.cc3
-rw-r--r--src/lib/video_content.cc3
-rw-r--r--src/lib/writer.cc9
-rw-r--r--src/lib/wscript1
-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
-rw-r--r--src/wx/content_panel.cc3
-rw-r--r--src/wx/film_viewer.cc2
-rw-r--r--src/wx/kdm_dialog.cc2
-rw-r--r--src/wx/kdm_output_panel.cc5
-rw-r--r--src/wx/kdm_output_panel.h3
48 files changed, 87 insertions, 183 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index 95b3a130d..440510ce5 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -21,6 +21,7 @@
#include "audio_decoder.h"
#include "audio_buffers.h"
#include "audio_content.h"
+#include "dcpomatic_log.h"
#include "log.h"
#include "resampler.h"
#include "compose.hpp"
@@ -29,8 +30,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::cout;
using std::map;
using std::pair;
diff --git a/src/lib/butler.cc b/src/lib/butler.cc
index 409963016..94230d094 100644
--- a/src/lib/butler.cc
+++ b/src/lib/butler.cc
@@ -22,15 +22,13 @@
#include "player.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "cross.h"
#include "compose.hpp"
#include "exceptions.h"
#include <boost/weak_ptr.hpp>
#include <boost/shared_ptr.hpp>
-#define LOG_TIMING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_WARNING(...) _log->log (String::compose(__VA_ARGS__), LogEntry::TYPE_WARNING);
-
using std::cout;
using std::pair;
using std::make_pair;
@@ -57,7 +55,6 @@ using boost::function;
*/
Butler::Butler (
shared_ptr<Player> player,
- shared_ptr<Log> log,
AudioMapping audio_mapping,
int audio_channels,
function<AVPixelFormat (AVPixelFormat)> pixel_format,
@@ -65,7 +62,6 @@ Butler::Butler (
bool fast
)
: _player (player)
- , _log (log)
, _prepare_work (new boost::asio::io_service::work (_prepare_service))
, _pending_seek_accurate (false)
, _suspended (0)
@@ -95,9 +91,7 @@ Butler::Butler (
multi-thread JPEG2000 decoding.
*/
- if (_log) {
- LOG_TIMING("start-prepare-threads %1", boost::thread::hardware_concurrency() * 2);
- }
+ LOG_TIMING("start-prepare-threads %1", boost::thread::hardware_concurrency() * 2);
for (size_t i = 0; i < boost::thread::hardware_concurrency() * 2; ++i) {
_prepare_pool.create_thread (bind (&boost::asio::io_service::run, &_prepare_service));
@@ -140,11 +134,11 @@ Butler::should_run () const
(__FILE__, __LINE__, String::compose ("Butler audio buffers reached %1 frames (video is %2)", _audio.size(), _video.size()));
}
- if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 2 && _log) {
+ if (_video.size() >= MAXIMUM_VIDEO_READAHEAD * 2) {
LOG_WARNING ("Butler video buffers reached %1 frames (audio is %2)", _video.size(), _audio.size());
}
- if (_audio.size() >= MAXIMUM_AUDIO_READAHEAD * 2 && _log) {
+ if (_audio.size() >= MAXIMUM_AUDIO_READAHEAD * 2) {
LOG_WARNING ("Butler audio buffers reached %1 frames (video is %2)", _audio.size(), _video.size());
}
@@ -279,15 +273,9 @@ Butler::prepare (weak_ptr<PlayerVideo> weak_video) const
shared_ptr<PlayerVideo> video = weak_video.lock ();
/* If the weak_ptr cannot be locked the video obviously no longer requires any work */
if (video) {
- if (_log) {
- LOG_TIMING("start-prepare in %1", thread_id());
- }
-
+ LOG_TIMING("start-prepare in %1", thread_id());
video->prepare (_pixel_format, _aligned, _fast);
-
- if (_log) {
- LOG_TIMING("finish-prepare in %1", thread_id());
- }
+ LOG_TIMING("finish-prepare in %1", thread_id());
}
}
diff --git a/src/lib/butler.h b/src/lib/butler.h
index b1debfca2..4f4e50884 100644
--- a/src/lib/butler.h
+++ b/src/lib/butler.h
@@ -32,14 +32,12 @@
class Player;
class PlayerVideo;
-class Log;
class Butler : public ExceptionStore, public boost::noncopyable
{
public:
Butler (
boost::shared_ptr<Player> player,
- boost::shared_ptr<Log> log,
AudioMapping map,
int audio_channels,
boost::function<AVPixelFormat (AVPixelFormat)> pixel_format,
@@ -75,7 +73,6 @@ private:
void seek_unlocked (DCPTime position, bool accurate);
boost::shared_ptr<Player> _player;
- boost::shared_ptr<Log> _log;
boost::thread* _thread;
/** mutex to protect _video, _audio and _closed_caption for when we are clearing them and they all need to be
diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc
index aaeb0d905..f5d9aef41 100644
--- a/src/lib/cinema_kdms.cc
+++ b/src/lib/cinema_kdms.cc
@@ -27,6 +27,7 @@
#include "emailer.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include <zip.h>
#include <boost/foreach.hpp>
@@ -184,7 +185,6 @@ CinemaKDMs::write_zip_files (
* @param filename_format Format of filenames to use.
* @param name_values Values to substitute into \p container_name_format and \p filename_format.
* @param cpl_name Name of the CPL that the KDMs are for.
- * @param log Log to write email session transcript to, or 0.
*/
void
CinemaKDMs::email (
@@ -192,8 +192,7 @@ CinemaKDMs::email (
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- string cpl_name,
- shared_ptr<Log> log
+ string cpl_name
)
{
Config* config = Config::instance ();
@@ -249,22 +248,18 @@ CinemaKDMs::email (
email.send (c->mail_server(), c->mail_port(), c->mail_user(), c->mail_password());
} catch (...) {
boost::filesystem::remove (zip_file);
- if (log) {
- log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
- log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
- }
+ dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
throw;
}
boost::filesystem::remove (zip_file);
- if (log) {
- log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
- log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
- log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
- }
+ dcpomatic_log->log ("Email content follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.email(), LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log ("Email session follows", LogEntry::TYPE_DEBUG_EMAIL);
+ dcpomatic_log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL);
}
}
diff --git a/src/lib/cinema_kdms.h b/src/lib/cinema_kdms.h
index 9d4887f5a..566b947a2 100644
--- a/src/lib/cinema_kdms.h
+++ b/src/lib/cinema_kdms.h
@@ -54,8 +54,7 @@ public:
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- std::string cpl_name,
- boost::shared_ptr<Log> log
+ std::string cpl_name
);
boost::shared_ptr<Cinema> cinema;
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc
index 30f02546c..f123061b7 100644
--- a/src/lib/content_factory.cc
+++ b/src/lib/content_factory.cc
@@ -34,6 +34,7 @@
#include "video_mxf_content.h"
#include "film.h"
#include "log_entry.h"
+#include "dcpomatic_log.h"
#include "log.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
@@ -47,8 +48,6 @@ using std::list;
using boost::shared_ptr;
using boost::optional;
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
/** Create a Content object from an XML node.
* @param node XML description.
* @param version XML state version.
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 75205dc1a..61b150a3b 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -21,6 +21,7 @@
#include "cross.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include "config.h"
#include "exceptions.h"
extern "C" {
@@ -53,10 +54,6 @@ extern "C" {
#include "i18n.h"
-#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_ERROR_NC(...) log->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::pair;
using std::list;
using std::ifstream;
@@ -182,7 +179,7 @@ shared_path ()
}
void
-run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, shared_ptr<Log> log)
+run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
{
#ifdef DCPOMATIC_WINDOWS
SECURITY_ATTRIBUTES security;
diff --git a/src/lib/cross.h b/src/lib/cross.h
index f1af03346..cd0372338 100644
--- a/src/lib/cross.h
+++ b/src/lib/cross.h
@@ -39,7 +39,7 @@ struct AVIOContext;
void dcpomatic_sleep (int);
extern std::string cpu_info ();
-extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
+extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path);
extern std::list<std::pair<std::string, std::string> > mount_info ();
extern boost::filesystem::path openssl_path ();
#ifdef DCPOMATIC_OSX
diff --git a/src/lib/dcp.cc b/src/lib/dcp.cc
index 1bf15ca24..f506d5c70 100644
--- a/src/lib/dcp.cc
+++ b/src/lib/dcp.cc
@@ -22,6 +22,7 @@
#include "config.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include "dcp_content.h"
#include <dcp/dcp.h>
@@ -35,8 +36,6 @@ using std::list;
using std::string;
using boost::shared_ptr;
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
/** Find all the CPLs in our directories, cross-add assets and return the CPLs */
list<shared_ptr<dcp::CPL> >
DCP::cpls () const
diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc
index 3110f93ad..b455e7f7f 100644
--- a/src/lib/dcp_content.cc
+++ b/src/lib/dcp_content.cc
@@ -29,6 +29,7 @@
#include "compose.hpp"
#include "dcp_decoder.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "text_content.h"
#include <dcp/dcp.h>
#include <dcp/raw_convert.h>
@@ -64,8 +65,6 @@ int const DCPContentProperty::NAME = 605;
int const DCPContentProperty::TEXTS = 606;
int const DCPContentProperty::CPL = 607;
-#define LOG_GENERAL(...) dcpomatic_log->log(String::compose(__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
DCPContent::DCPContent (boost::filesystem::path p)
: _encrypted (false)
, _needs_assets (false)
diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc
index 31d166194..6f32b6686 100644
--- a/src/lib/dcp_video.cc
+++ b/src/lib/dcp_video.cc
@@ -35,6 +35,7 @@
#include "dcpomatic_socket.h"
#include "image.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "cross.h"
#include "player_video.h"
#include "compose.hpp"
@@ -50,10 +51,6 @@
#include <iomanip>
#include <iostream>
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_DEBUG_ENCODE(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-#define LOG_TIMING(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-
#include "i18n.h"
using std::string;
@@ -69,24 +66,21 @@ using dcp::raw_convert;
* @param frame Input frame.
* @param index Index of the frame within the DCP.
* @param bw J2K bandwidth to use (see Config::j2k_bandwidth ())
- * @param l Log to write to.
*/
DCPVideo::DCPVideo (
- shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r, shared_ptr<Log> l
+ shared_ptr<const PlayerVideo> frame, int index, int dcp_fps, int bw, Resolution r
)
: _frame (frame)
, _index (index)
, _frames_per_second (dcp_fps)
, _j2k_bandwidth (bw)
, _resolution (r)
- , _log (l)
{
}
-DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::Node> node, shared_ptr<Log> log)
+DCPVideo::DCPVideo (shared_ptr<const PlayerVideo> frame, shared_ptr<const cxml::Node> node)
: _frame (frame)
- , _log (log)
{
_index = node->number_child<int> ("Index");
_frames_per_second = node->number_child<int> ("FramesPerSecond");
@@ -119,10 +113,10 @@ DCPVideo::convert_to_xyz (shared_ptr<const PlayerVideo> frame, dcp::NoteHandler
* @return Encoded data.
*/
Data
-DCPVideo::encode_locally (dcp::NoteHandler note)
+DCPVideo::encode_locally ()
{
Data enc = compress_j2k (
- convert_to_xyz (_frame, note),
+ convert_to_xyz (_frame, boost::bind(&Log::dcp_log, dcpomatic_log.get(), _1, _2)),
_j2k_bandwidth,
_frames_per_second,
_frame->eyes() == EYES_LEFT || _frame->eyes() == EYES_RIGHT,
diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h
index 32cd1a169..81ddc4470 100644
--- a/src/lib/dcp_video.h
+++ b/src/lib/dcp_video.h
@@ -42,10 +42,10 @@ class PlayerVideo;
class DCPVideo : public boost::noncopyable
{
public:
- DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution, boost::shared_ptr<Log>);
- DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr, boost::shared_ptr<Log>);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, int, int, int, Resolution);
+ DCPVideo (boost::shared_ptr<const PlayerVideo>, cxml::ConstNodePtr);
- dcp::Data encode_locally (dcp::NoteHandler note);
+ dcp::Data encode_locally ();
dcp::Data encode_remotely (EncodeServerDescription, int timeout = 30);
int index () const {
@@ -67,6 +67,4 @@ private:
int _frames_per_second; ///< Frames per second that we will use for the DCP
int _j2k_bandwidth; ///< J2K bandwidth to use
Resolution _resolution; ///< Resolution (2K or 4K)
-
- boost::shared_ptr<Log> _log; ///< log
};
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc
index 2603732c8..9902c8e84 100644
--- a/src/lib/encode_server.cc
+++ b/src/lib/encode_server.cc
@@ -33,6 +33,7 @@
#include "player_video.h"
#include "compose.hpp"
#include "log.h"
+#include "dcpomatic_log.h"
#include "encoded_log_entry.h"
#include "version.h"
#include <dcp/raw_convert.h>
@@ -50,11 +51,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _log->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) _log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_ERROR_NC(...) _log->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::string;
using std::vector;
using std::list;
@@ -70,13 +66,12 @@ using dcp::Size;
using dcp::Data;
using dcp::raw_convert;
-EncodeServer::EncodeServer (shared_ptr<Log> log, bool verbose, int num_threads)
+EncodeServer::EncodeServer (bool verbose, int num_threads)
#if !defined(RUNNING_ON_VALGRIND) || RUNNING_ON_VALGRIND == 0
: Server (ENCODE_FRAME_PORT)
#else
: Server (ENCODE_FRAME_PORT, 2400)
#endif
- , _log (log)
, _verbose (verbose)
, _num_threads (num_threads)
{
@@ -141,11 +136,11 @@ EncodeServer::process (shared_ptr<Socket> socket, struct timeval& after_read, st
shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket));
- DCPVideo dcp_video_frame (pvf, xml, _log);
+ DCPVideo dcp_video_frame (pvf, xml);
gettimeofday (&after_read, 0);
- Data encoded = dcp_video_frame.encode_locally (boost::bind (&Log::dcp_log, _log.get(), _1, _2));
+ Data encoded = dcp_video_frame.encode_locally ();
gettimeofday (&after_encode, 0);
@@ -220,7 +215,7 @@ EncodeServer::worker_thread ()
cout << e->get() << "\n";
}
- _log->log (e);
+ dcpomatic_log->log (e);
}
_full_condition.notify_all ();
diff --git a/src/lib/encode_server.h b/src/lib/encode_server.h
index 00a1b6b12..c9bd55718 100644
--- a/src/lib/encode_server.h
+++ b/src/lib/encode_server.h
@@ -42,7 +42,7 @@ class Log;
class EncodeServer : public Server, public ExceptionStore
{
public:
- EncodeServer (boost::shared_ptr<Log> log, bool verbose, int num_threads);
+ EncodeServer (bool verbose, int num_threads);
~EncodeServer ();
void run ();
@@ -58,7 +58,6 @@ private:
std::list<boost::shared_ptr<Socket> > _queue;
boost::condition _full_condition;
boost::condition _empty_condition;
- boost::shared_ptr<Log> _log;
bool _verbose;
int _num_threads;
diff --git a/src/lib/environment_info.cc b/src/lib/environment_info.cc
index 68496f996..31279acfb 100644
--- a/src/lib/environment_info.cc
+++ b/src/lib/environment_info.cc
@@ -35,9 +35,6 @@ extern "C" {
#include "i18n.h"
-#define LOG_GENERAL(...) log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) log->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
using std::string;
using std::list;
using std::pair;
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index 3bd08e84a..53829c5f2 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -24,6 +24,7 @@
#include "exceptions.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "ffmpeg_subtitle_stream.h"
#include "ffmpeg_audio_stream.h"
#include "digester.h"
@@ -49,7 +50,6 @@ using boost::optional;
using dcp::raw_convert;
boost::mutex FFmpeg::_mutex;
-boost::weak_ptr<Log> FFmpeg::_ffmpeg_log;
FFmpeg::FFmpeg (boost::shared_ptr<const FFmpegContent> c)
: _ffmpeg_content (c)
@@ -97,14 +97,9 @@ FFmpeg::ffmpeg_log_callback (void* ptr, int level, const char* fmt, va_list vl)
char line[1024];
static int prefix = 0;
av_log_format_line (ptr, level, fmt, vl, line, sizeof (line), &prefix);
- shared_ptr<Log> log = _ffmpeg_log.lock ();
- if (log) {
- string str (line);
- boost::algorithm::trim (str);
- log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
- } else {
- cerr << line;
- }
+ string str (line);
+ boost::algorithm::trim (str);
+ dcpomatic_log->log (String::compose ("FFmpeg: %1", str), LogEntry::TYPE_GENERAL);
}
void
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc
index fcadc9116..34a6e1444 100644
--- a/src/lib/ffmpeg_content.cc
+++ b/src/lib/ffmpeg_content.cc
@@ -45,8 +45,6 @@ extern "C" {
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::string;
using std::vector;
using std::list;
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index fbc0ee416..3d9e965a9 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -27,6 +27,7 @@
#include "image.h"
#include "util.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "ffmpeg_decoder.h"
#include "text_decoder.h"
#include "ffmpeg_audio_stream.h"
@@ -58,10 +59,6 @@ extern "C" {
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_WARNING_NC(...) dcpomatic_log->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_WARNING(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
using std::cout;
using std::string;
diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc
index 8bb9b5e45..07b691956 100644
--- a/src/lib/ffmpeg_encoder.cc
+++ b/src/lib/ffmpeg_encoder.cc
@@ -73,7 +73,6 @@ FFmpegEncoder::FFmpegEncoder (
_film->video_frame_rate(),
_film->audio_frame_rate(),
mixdown_to_stereo ? 2 : film->audio_channels(),
- _film->log(),
format,
x264_crf,
_film->three_d(),
@@ -108,7 +107,7 @@ FFmpegEncoder::FFmpegEncoder (
}
}
- _butler.reset (new Butler (_player, film->log(), map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), true, false));
+ _butler.reset (new Butler(_player, map, _output_audio_channels, bind(&PlayerVideo::force, _1, FFmpegFileEncoder::pixel_format(format)), true, false));
}
void
@@ -191,7 +190,6 @@ FFmpegEncoder::FileEncoderSet::FileEncoderSet (
int video_frame_rate,
int audio_frame_rate,
int channels,
- shared_ptr<Log> log,
ExportFormat format,
int x264_crf,
bool three_d,
@@ -202,15 +200,15 @@ FFmpegEncoder::FileEncoderSet::FileEncoderSet (
if (three_d) {
/// TRANSLATORS: L here is an abbreviation for "left", to indicate the left-eye part of a 3D export
_encoders[EYES_LEFT] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1_%2%3", output.string(), _("L"), extension))
);
/// TRANSLATORS: R here is an abbreviation for "left", to indicate the left-eye part of a 3D export
_encoders[EYES_RIGHT] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1_%2%3", output.string(), _("R"), extension))
);
} else {
_encoders[EYES_BOTH] = shared_ptr<FFmpegFileEncoder>(
- new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, log, format, x264_crf, String::compose("%1%2", output.string(), extension))
+ new FFmpegFileEncoder(video_frame_size, video_frame_rate, audio_frame_rate, channels, format, x264_crf, String::compose("%1%2", output.string(), extension))
);
}
}
diff --git a/src/lib/ffmpeg_encoder.h b/src/lib/ffmpeg_encoder.h
index 5356c5ce2..79539acce 100644
--- a/src/lib/ffmpeg_encoder.h
+++ b/src/lib/ffmpeg_encoder.h
@@ -59,7 +59,6 @@ private:
int video_frame_rate,
int audio_frame_rate,
int channels,
- boost::shared_ptr<Log> log,
ExportFormat,
int x264_crf,
bool three_d,
diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc
index 804022f0b..2c67bb5f9 100644
--- a/src/lib/ffmpeg_file_encoder.cc
+++ b/src/lib/ffmpeg_file_encoder.cc
@@ -47,7 +47,6 @@ FFmpegFileEncoder::FFmpegFileEncoder (
int video_frame_rate,
int audio_frame_rate,
int channels,
- shared_ptr<Log> log,
ExportFormat format,
int x264_crf,
boost::filesystem::path output
@@ -58,7 +57,6 @@ FFmpegFileEncoder::FFmpegFileEncoder (
, _video_frame_size (video_frame_size)
, _video_frame_rate (video_frame_rate)
, _audio_frame_rate (audio_frame_rate)
- , _log (log)
{
_pixel_format = pixel_format (format);
diff --git a/src/lib/ffmpeg_file_encoder.h b/src/lib/ffmpeg_file_encoder.h
index 63826e2d5..8b9d0b67c 100644
--- a/src/lib/ffmpeg_file_encoder.h
+++ b/src/lib/ffmpeg_file_encoder.h
@@ -38,7 +38,6 @@ public:
int video_frame_rate,
int audio_frame_rate,
int channels,
- boost::shared_ptr<Log> log,
ExportFormat,
int x264_crf,
boost::filesystem::path output
@@ -79,7 +78,6 @@ private:
dcp::Size _video_frame_size;
int _video_frame_rate;
int _audio_frame_rate;
- boost::shared_ptr<Log> _log;
boost::shared_ptr<AudioBuffers> _pending_audio;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 4d6b3d7e3..60b80d052 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -32,6 +32,7 @@
#include "upload_job.h"
#include "null_log.h"
#include "file_log.h"
+#include "dcpomatic_log.h"
#include "exceptions.h"
#include "examine_content_job.h"
#include "config.h"
@@ -98,9 +99,6 @@ using boost::optional;
using boost::is_any_of;
using dcp::raw_convert;
-#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
string const Film::metadata_file = "metadata.xml";
/* 5 -> 6
@@ -1087,7 +1085,7 @@ void
Film::examine_and_add_content (shared_ptr<Content> content, bool disable_audio_analysis)
{
if (dynamic_pointer_cast<FFmpegContent> (content) && _directory) {
- run_ffprobe (content->path(0), file ("ffprobe.log"), _log);
+ run_ffprobe (content->path(0), file("ffprobe.log"));
}
shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), content));
diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc
index f92f23168..94728d6a9 100644
--- a/src/lib/j2k_encoder.cc
+++ b/src/lib/j2k_encoder.cc
@@ -26,6 +26,7 @@
#include "util.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "config.h"
#include "dcp_video.h"
#include "cross.h"
@@ -41,12 +42,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-
using std::list;
using std::cout;
using boost::shared_ptr;
@@ -134,9 +129,9 @@ J2KEncoder::end ()
LOG_GENERAL (N_("Encode left-over frame %1"), (*i)->index ());
try {
_writer->write (
- (*i)->encode_locally (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2)),
- (*i)->index (),
- (*i)->eyes ()
+ (*i)->encode_locally(),
+ (*i)->index(),
+ (*i)->eyes()
);
frame_done ();
} catch (std::exception& e) {
@@ -233,8 +228,7 @@ J2KEncoder::encode (shared_ptr<PlayerVideo> pv, DCPTime time)
position,
_film->video_frame_rate(),
_film->j2k_bandwidth(),
- _film->resolution(),
- _film->log()
+ _film->resolution()
)
));
@@ -338,7 +332,7 @@ try
} else {
try {
LOG_TIMING ("start-local-encode thread=%1 frame=%2", thread_id(), vf->index());
- encoded = vf->encode_locally (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
+ encoded = vf->encode_locally ();
LOG_TIMING ("finish-local-encode thread=%1 frame=%2", thread_id(), vf->index());
} catch (std::exception& e) {
/* This is very bad, so don't cope with it, just pass it on */
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 7539a5070..dde8cce62 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -28,6 +28,7 @@
#include "exceptions.h"
#include "film.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include <dcp/exceptions.h>
#include <sub/exceptions.h>
@@ -46,9 +47,6 @@ using boost::shared_ptr;
using boost::optional;
using boost::function;
-#define LOG_ERROR_NC(...) if (_film) { _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR); }
-#define LOG_GENERAL(...) if (_film) { _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL); }
-
/** @param film Associated film, or 0 */
Job::Job (shared_ptr<const Film> film)
: _film (film)
diff --git a/src/lib/log.cc b/src/lib/log.cc
index 8f7794aed..e3ffd1cad 100644
--- a/src/lib/log.cc
+++ b/src/lib/log.cc
@@ -35,8 +35,6 @@ using std::string;
using std::cout;
using boost::shared_ptr;
-boost::shared_ptr<Log> dcpomatic_log;
-
Log::Log ()
: _types (0)
{
diff --git a/src/lib/log.h b/src/lib/log.h
index 636de6a58..65d0229e9 100644
--- a/src/lib/log.h
+++ b/src/lib/log.h
@@ -66,6 +66,4 @@ private:
boost::signals2::scoped_connection _config_connection;
};
-extern boost::shared_ptr<Log> dcpomatic_log;
-
#endif
diff --git a/src/lib/player.cc b/src/lib/player.cc
index 5a71c1330..ae16290f5 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -60,8 +60,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
using std::list;
using std::cout;
using std::min;
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index 9a600a739..350120d9d 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -23,6 +23,7 @@
#include "cross.h"
#include "job.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "digester.h"
#include "font.h"
#include "compose.hpp"
@@ -49,11 +50,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-
using std::list;
using std::string;
using std::cout;
diff --git a/src/lib/send_kdm_email_job.cc b/src/lib/send_kdm_email_job.cc
index eff77ce43..38484b91e 100644
--- a/src/lib/send_kdm_email_job.cc
+++ b/src/lib/send_kdm_email_job.cc
@@ -35,15 +35,13 @@ using boost::shared_ptr;
* @param filename_format Format to use for filenames.
* @param name_values Values to substitute into \p container_name_format and \p filename_format.
* @param cpl_name Name of the CPL that the KDMs are for.
- * @param log Log to write to, or 0.
*/
SendKDMEmailJob::SendKDMEmailJob (
list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- string cpl_name,
- shared_ptr<Log> log
+ string cpl_name
)
: Job (shared_ptr<Film>())
, _container_name_format (container_name_format)
@@ -51,7 +49,6 @@ SendKDMEmailJob::SendKDMEmailJob (
, _name_values (name_values)
, _cpl_name (cpl_name)
, _cinema_kdms (cinema_kdms)
- , _log (log)
{
}
@@ -77,7 +74,7 @@ void
SendKDMEmailJob::run ()
{
set_progress_unknown ();
- CinemaKDMs::email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name, _log);
+ CinemaKDMs::email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name);
set_progress (1);
set_state (FINISHED_OK);
}
diff --git a/src/lib/send_kdm_email_job.h b/src/lib/send_kdm_email_job.h
index 88de1e9fe..b4e007e3b 100644
--- a/src/lib/send_kdm_email_job.h
+++ b/src/lib/send_kdm_email_job.h
@@ -35,8 +35,7 @@ public:
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
dcp::NameFormat::Map name_values,
- std::string cpl_name,
- boost::shared_ptr<Log> log
+ std::string cpl_name
);
std::string name () const;
@@ -49,5 +48,4 @@ private:
dcp::NameFormat::Map _name_values;
std::string _cpl_name;
std::list<CinemaKDMs> _cinema_kdms;
- boost::shared_ptr<Log> _log;
};
diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc
index 420f5a8d2..15711a796 100644
--- a/src/lib/transcode_job.cc
+++ b/src/lib/transcode_job.cc
@@ -29,16 +29,13 @@
#include "film.h"
#include "encoder.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "compose.hpp"
#include <iostream>
#include <iomanip>
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
-
using std::string;
using std::fixed;
using std::setprecision;
diff --git a/src/lib/upload_job.cc b/src/lib/upload_job.cc
index 4726c734a..cbcb8dfc6 100644
--- a/src/lib/upload_job.cc
+++ b/src/lib/upload_job.cc
@@ -26,6 +26,7 @@
#include "upload_job.h"
#include "config.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "film.h"
#include "scp_uploader.h"
#include "curl_uploader.h"
@@ -33,8 +34,6 @@
#include "i18n.h"
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
using std::string;
using std::min;
using boost::shared_ptr;
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc
index 15445a68a..932977858 100644
--- a/src/lib/video_content.cc
+++ b/src/lib/video_content.cc
@@ -30,6 +30,7 @@
#include "exceptions.h"
#include "frame_rate_change.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
@@ -38,8 +39,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) dcpomatic_log->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
int const VideoContentProperty::SIZE = 0;
int const VideoContentProperty::FRAME_TYPE = 1;
int const VideoContentProperty::CROP = 2;
diff --git a/src/lib/writer.cc b/src/lib/writer.cc
index 893c009cd..c31ae2a91 100644
--- a/src/lib/writer.cc
+++ b/src/lib/writer.cc
@@ -23,6 +23,7 @@
#include "film.h"
#include "ratio.h"
#include "log.h"
+#include "dcpomatic_log.h"
#include "dcp_video.h"
#include "dcp_content_type.h"
#include "audio_mapping.h"
@@ -44,14 +45,6 @@
#include "i18n.h"
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-#define LOG_DEBUG_ENCODE(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_DEBUG_ENCODE);
-#define LOG_TIMING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_TIMING);
-#define LOG_WARNING_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_WARNING);
-#define LOG_WARNING(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_WARNING);
-#define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_ERROR);
-
/* OS X strikes again */
#undef set_key
diff --git a/src/lib/wscript b/src/lib/wscript
index 88cec75ec..7c332e88d 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -63,6 +63,7 @@ sources = """
dcp_subtitle_decoder.cc
dcp_text_track.cc
dcp_video.cc
+ dcpomatic_log.cc
dcpomatic_socket.cc
dcpomatic_time.cc
decoder.cc
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;
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 93b270faa..89690a5d0 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -41,6 +41,7 @@
#include "lib/compose.hpp"
#include "lib/string_text_file_content.h"
#include "lib/string_text_file.h"
+#include "lib/dcpomatic_log.h"
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
@@ -59,8 +60,6 @@ using boost::weak_ptr;
using boost::dynamic_pointer_cast;
using boost::optional;
-#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-
ContentPanel::ContentPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
: _video_panel (0)
, _audio_panel (0)
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 2d489b3e8..66b919a75 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -193,7 +193,7 @@ FilmViewer::recreate_butler ()
map.set (dcp::RS, 1, 1 / sqrt(2)); // Rs -> Rt
}
- _butler.reset (new Butler(_player, _film->log(), map, _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+ _butler.reset (new Butler(_player, map, _audio_channels, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
if (!Config::instance()->sound() && !_audio.isStreamOpen()) {
_butler->disable_audio ();
}
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 45dc2b477..abb28c228 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -153,7 +153,7 @@ KDMDialog::make_clicked ()
return;
}
- pair<shared_ptr<Job>, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1), film->log());
+ pair<shared_ptr<Job>, int> result = _output->make (screen_kdms, film->name(), _timing, bind (&KDMDialog::confirm_overwrite, this, _1));
if (result.first) {
JobManager::instance()->add (result.first);
}
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index 07bbce2d2..694957ee8 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -179,7 +179,7 @@ KDMOutputPanel::kdm_write_type_changed ()
pair<shared_ptr<Job>, int>
KDMOutputPanel::make (
- list<ScreenKDM> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite, shared_ptr<Log> log
+ list<ScreenKDM> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
)
{
list<CinemaKDMs> const cinema_kdms = CinemaKDMs::collect (screen_kdms);
@@ -278,8 +278,7 @@ KDMOutputPanel::make (
_container_name_format->get(),
_filename_format->get(),
name_values,
- name,
- log
+ name
)
);
}
diff --git a/src/wx/kdm_output_panel.h b/src/wx/kdm_output_panel.h
index ba947b714..ed162e053 100644
--- a/src/wx/kdm_output_panel.h
+++ b/src/wx/kdm_output_panel.h
@@ -52,8 +52,7 @@ public:
std::list<ScreenKDM> screen_kdms,
std::string name,
KDMTimingPanel* timing,
- boost::function<bool (boost::filesystem::path)> confirm_overwrite,
- boost::shared_ptr<Log> log
+ boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
private: