diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-11 22:18:57 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-11 22:18:57 +0100 |
| commit | c658aec3ffd5009cbe7fa2540da5a0579e2f2e8c (patch) | |
| tree | b460bea7792310d4c89a15601fea04d9db83b52c /src/lib/cinema_kdms.cc | |
| parent | 27bd2c44278ccf181b11ba961649a3e9b3ae03af (diff) | |
Add debug option to log SMTP session transcripts.
Diffstat (limited to 'src/lib/cinema_kdms.cc')
| -rw-r--r-- | src/lib/cinema_kdms.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/cinema_kdms.cc b/src/lib/cinema_kdms.cc index 9584a3f23..37c9e1fb5 100644 --- a/src/lib/cinema_kdms.cc +++ b/src/lib/cinema_kdms.cc @@ -25,6 +25,7 @@ #include "util.h" #include "emailer.h" #include "compose.hpp" +#include "log.h" #include <zip.h> #include <boost/foreach.hpp> @@ -113,9 +114,12 @@ CinemaKDMs::write_zip_files (string film_name, list<CinemaKDMs> cinema_kdms, boo } } +/** @param log Log to write email session transcript to, or 0 */ /* XXX: should probably get from/to from the KDMs themselves */ void -CinemaKDMs::email (string film_name, string cpl_name, list<CinemaKDMs> cinema_kdms, dcp::LocalTime from, dcp::LocalTime to, shared_ptr<Job> job) +CinemaKDMs::email ( + string film_name, string cpl_name, list<CinemaKDMs> cinema_kdms, dcp::LocalTime from, dcp::LocalTime to, shared_ptr<Job> job, shared_ptr<Log> log + ) { Config* config = Config::instance (); @@ -159,5 +163,9 @@ CinemaKDMs::email (string film_name, string cpl_name, list<CinemaKDMs> cinema_kd string const name = tidy_for_filename(i.cinema->name) + "_" + tidy_for_filename(film_name) + ".zip"; email.add_attachment (zip_file, name, "application/zip"); email.send (job); + + if (log) { + log->log (email.notes(), LogEntry::TYPE_DEBUG_EMAIL); + } } } |
