diff options
author | Matthias Braendli <matthias.braendli@u-blox.com> | 2015-06-02 12:25:40 +0200 |
---|---|---|
committer | Matthias Braendli <matthias.braendli@u-blox.com> | 2015-06-02 12:27:42 +0200 |
commit | e3cc55d32281be5dd7b7017d6dfed42be24d3cda (patch) | |
tree | c589cedc7bd1cabfdf1aee9a65f00037006e7c22 /src/InputZeroMQReader.cpp | |
parent | 7eaba8024b95bb346247c828748d2292c226d19f (diff) | |
download | dabmod-e3cc55d32281be5dd7b7017d6dfed42be24d3cda.tar.gz dabmod-e3cc55d32281be5dd7b7017d6dfed42be24d3cda.tar.bz2 dabmod-e3cc55d32281be5dd7b7017d6dfed42be24d3cda.zip |
Logging: use etiLog instead of stderr
Diffstat (limited to 'src/InputZeroMQReader.cpp')
-rw-r--r-- | src/InputZeroMQReader.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/InputZeroMQReader.cpp b/src/InputZeroMQReader.cpp index eb50669..8706e1e 100644 --- a/src/InputZeroMQReader.cpp +++ b/src/InputZeroMQReader.cpp @@ -134,16 +134,14 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) } else if (queue_size < workerdata->max_queued_frames) { if (buffer_full) { - fprintf(stderr, "ZeroMQ buffer recovered: %zu elements\n", - queue_size); + etiLog.level(info) << "ZeroMQ buffer recovered: " << queue_size << " elements"; buffer_full = false; } zmq_dab_message_t* dab_msg = (zmq_dab_message_t*)incoming.data(); if (dab_msg->version != 1) { - fprintf(stderr, "ZeroMQ input: wrong packet version %d\n", - dab_msg->version); + etiLog.level(error) << "ZeroMQ wrong packet version " << dab_msg->version; } int offset = sizeof(dab_msg->version) + @@ -154,8 +152,8 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) if (dab_msg->buflen[i] <= 0 || dab_msg->buflen[i] > 6144) { - fprintf(stderr, "ZeroMQ buffer %d: invalid length %d\n", - i, dab_msg->buflen[i]); + etiLog.level(error) << "ZeroMQ buffer " << i << " has invalid length " << + dab_msg->buflen[i]; // TODO error handling } else { @@ -178,7 +176,7 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) workerdata->in_messages->notify(); if (!buffer_full) { - fprintf(stderr, "ZeroMQ buffer overfull !\n"); + etiLog.level(warn) << "ZeroMQ buffer overfull !"; buffer_full = true; throw std::runtime_error("ZMQ input full"); @@ -195,18 +193,17 @@ void InputZeroMQWorker::RecvProcess(struct InputZeroMQThreadData* workerdata) } if (queue_size < 5) { - fprintf(stderr, "ZeroMQ buffer low: %zu elements !\n", - queue_size); + etiLog.level(warn) << "ZeroMQ buffer low: " << queue_size << "elements !"; } } } catch (zmq::error_t& err) { - fprintf(stderr, "ZeroMQ error in RecvProcess: '%s'\n", err.what()); + etiLog.level(error) << "ZeroMQ error in RecvProcess: '" << err.what() << "'"; } catch (std::exception& err) { } - fprintf(stderr, "ZeroMQ input worker terminated\n"); + etiLog.level(info) << "ZeroMQ input worker terminated"; subscriber.close(); |