summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-12-06 21:40:56 +0000
committerCarl Hetherington <cth@carlh.net>2012-12-06 21:40:56 +0000
commitb4ec9ce787c63b27c96c404b1bd44eccd56ab16e (patch)
tree8a8b203ef1a8483961ed8a043b555bffdfa8314c /src/lib
parent1e0f726e313638f7748e72545d0038cfcffde229 (diff)
More logging tweaks; allow log level to be specified on the command line; bump libdcp version.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg_decoder.cc2
-rw-r--r--src/lib/log.cc13
-rw-r--r--src/lib/log.h6
3 files changed, 17 insertions, 4 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index 49e03b1ce..9b89ffffc 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -279,7 +279,7 @@ FFmpegDecoder::pass ()
_film->log()->log (
String::compose ("Source video frame ready; source at %1, output at %2", source_pts_seconds, out_pts_seconds),
- Log::DEBUG
+ Log::VERBOSE
);
if (!_first_video) {
diff --git a/src/lib/log.cc b/src/lib/log.cc
index 650384bc7..06cff0495 100644
--- a/src/lib/log.cc
+++ b/src/lib/log.cc
@@ -76,6 +76,19 @@ Log::set_level (Level l)
_level = l;
}
+void
+Log::set_level (string l)
+{
+ if (l == "verbose") {
+ set_level (VERBOSE);
+ return;
+ } else if (l == "timing") {
+ set_level (TIMING);
+ return;
+ }
+
+ set_level (STANDARD);
+}
/** @param file Filename to write log to */
FileLog::FileLog (string file)
diff --git a/src/lib/log.h b/src/lib/log.h
index c5241ebcf..3a2cfcbfd 100644
--- a/src/lib/log.h
+++ b/src/lib/log.h
@@ -37,16 +37,16 @@ public:
virtual ~Log () {}
enum Level {
- SILENT = 0,
+ STANDARD = 0,
VERBOSE = 1,
- DEBUG = 2,
- TIMING = 3
+ TIMING = 2
};
void log (std::string m, Level l = STANDARD);
void microsecond_log (std::string m, Level l = STANDARD);
void set_level (Level l);
+ void set_level (std::string l);
protected:
/** mutex to protect the log */