diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-08-31 18:57:19 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-08-31 18:57:19 +0200 |
commit | 73d0a6134a9060a9f3cf15b5ce76a5f2747fb1f2 (patch) | |
tree | 33a71a379faa2c27b569ce5c43f3ccfc42085886 /src/AlsaInput.cpp | |
parent | c4f0ba1c9c909f7c1ac697068197b681cd567beb (diff) | |
parent | d31dad0b24775cf84d308b94c3fbd0187c476c14 (diff) | |
download | ODR-AudioEnc-73d0a6134a9060a9f3cf15b5ce76a5f2747fb1f2.tar.gz ODR-AudioEnc-73d0a6134a9060a9f3cf15b5ce76a5f2747fb1f2.tar.bz2 ODR-AudioEnc-73d0a6134a9060a9f3cf15b5ce76a5f2747fb1f2.zip |
Merge PR #38 with logging improvements from rmens
Diffstat (limited to 'src/AlsaInput.cpp')
-rw-r--r-- | src/AlsaInput.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/AlsaInput.cpp b/src/AlsaInput.cpp index 442304c..7d14eb0 100644 --- a/src/AlsaInput.cpp +++ b/src/AlsaInput.cpp @@ -21,6 +21,7 @@ #if HAVE_ALSA #include "AlsaInput.h" +#include "Log.h" #include <cstdio> #include <stdexcept> #include <string> @@ -51,7 +52,7 @@ void AlsaInput::m_init_alsa() int err; snd_pcm_hw_params_t *hw_params; - fprintf(stderr, "Initialising ALSA...\n"); + etiLog.level(info) << "Initialising ALSA..."; const int open_mode = 0; @@ -104,7 +105,7 @@ void AlsaInput::m_init_alsa() alsa_strerror(err) + ")"); } - fprintf(stderr, "ALSA init done.\n"); + etiLog.level(info) << "ALSA init done."; } ssize_t AlsaInput::m_read(uint8_t* buf, snd_pcm_uframes_t length) @@ -115,11 +116,10 @@ ssize_t AlsaInput::m_read(uint8_t* buf, snd_pcm_uframes_t length) if (err != (ssize_t)length) { if (err < 0) { - fprintf (stderr, "read from audio interface failed (%s)\n", - snd_strerror(err)); + etiLog.level(error) << "read from audio interface failed (" << snd_strerror(err) << ")"; } else { - fprintf(stderr, "short alsa read: %d\n", err); + etiLog.level(warn) << "short alsa read: " << err; } } @@ -141,7 +141,7 @@ AlsaInputThreaded::~AlsaInputThreaded() void AlsaInputThreaded::prepare() { if (m_fault) { - fprintf(stderr, "Cannot start alsa input. Fault detected previsouly!\n"); + etiLog.level(error) << "Cannot start alsa input. Fault detected previously!"; } else { m_init_alsa(); |