diff options
author | Matthias P. Braendli (think) <matthias@mpb.li> | 2012-09-13 22:42:47 +0200 |
---|---|---|
committer | Matthias P. Braendli (think) <matthias@mpb.li> | 2012-09-13 22:42:47 +0200 |
commit | 47c823ac611c54ae8ce3af2da40f9db0ec9b9195 (patch) | |
tree | 669e233651e50ef3ce84df314cde9e7c0f3a7bf3 /src/TimestampDecoder.cpp | |
parent | 95db3fa1e516aefa239f0dbe06bcda674e57b6a1 (diff) | |
download | dabmod-47c823ac611c54ae8ce3af2da40f9db0ec9b9195.tar.gz dabmod-47c823ac611c54ae8ce3af2da40f9db0ec9b9195.tar.bz2 dabmod-47c823ac611c54ae8ce3af2da40f9db0ec9b9195.zip |
crc-dabmod: much cleaner logging implementation
Diffstat (limited to 'src/TimestampDecoder.cpp')
-rw-r--r-- | src/TimestampDecoder.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp index eb70a56..a0c457a 100644 --- a/src/TimestampDecoder.cpp +++ b/src/TimestampDecoder.cpp @@ -31,6 +31,7 @@ #include "PcDebug.h" #include "TimestampDecoder.h" #include "Eti.h" +#include "Log.h" //#define MDEBUG(fmt, args...) fprintf (LOG, fmt , ## args) #define MDEBUG(fmt, args...) PDEBUG(fmt, ## args) @@ -90,8 +91,8 @@ void TimestampDecoder::calculateTimestamp(struct frame_timestamp& ts) modconfig.delay_calculation_pipeline_stages); if (queue_timestamps.size() > modconfig.delay_calculation_pipeline_stages) { - fprintf(stderr, "Error: Timestamp queue is too large : size %zu ! This should not happen !\n", - queue_timestamps.size()); + myLogger.level(error) << "Error: Timestamp queue is too large : size " << + queue_timestamps.size() << "! This should not happen !"; } //ts.print("calc2 "); @@ -197,7 +198,7 @@ bool TimestampDecoder::updateModulatorOffset() if (modconfig.use_offset_fixed) { timestamp_offset = modconfig.offset_fixed; - PDEBUG("Setting timestamp offset to %f\n", timestamp_offset); + myLogger.level(info) << "Setting fixed offset to " << timestamp_offset; return true; } else if (modconfig.use_offset_file) @@ -210,7 +211,7 @@ bool TimestampDecoder::updateModulatorOffset() try { - filestream.open(modconfig.offset_filename); + filestream.open(modconfig.offset_filename.c_str()); if (!filestream.eof()) { getline(filestream, filedata); @@ -221,20 +222,20 @@ bool TimestampDecoder::updateModulatorOffset() } catch (bad_lexical_cast& e) { - fprintf(stderr, "Error parsing timestamp offset from file\n"); + myLogger.level(error) << "Error parsing timestamp offset from file '" << modconfig.offset_filename << "'"; r = false; } } else { - fprintf(stderr, "Error reading from timestamp offset file: eof reached\n"); + myLogger.level(error) << "Error reading from timestamp offset file: eof reached\n"; r = false; } filestream.close(); } catch (exception& e) { - fprintf(stderr, "Error opening timestamp offset file\n"); + myLogger.level(error) << "Error opening timestamp offset file\n"; r = false; } @@ -244,8 +245,7 @@ bool TimestampDecoder::updateModulatorOffset() if (timestamp_offset != newoffset) { timestamp_offset = newoffset; - fprintf(stderr, "TimestampDecoder::updateTimestampOffset:" \ - "new offset is %f\n", timestamp_offset); + myLogger.level(info) << "TimestampDecoder::updateTimestampOffset: new offset is " << timestamp_offset; offset_changed = true; } |