diff options
author | rmens <r.mens@me.com> | 2025-08-30 14:36:16 +0200 |
---|---|---|
committer | rmens <r.mens@me.com> | 2025-08-30 14:36:16 +0200 |
commit | 32cd3ce5ba33d85429365cbe2a43872371351fb9 (patch) | |
tree | 5ca34e4246ebba03ae61c6a36deef614645c4857 /src/AlsaInput.cpp | |
parent | 97540d37d069a5b7ae535755fec32f2a3116485b (diff) | |
download | ODR-AudioEnc-32cd3ce5ba33d85429365cbe2a43872371351fb9.tar.gz ODR-AudioEnc-32cd3ce5ba33d85429365cbe2a43872371351fb9.tar.bz2 ODR-AudioEnc-32cd3ce5ba33d85429365cbe2a43872371351fb9.zip |
feat: use etiLog
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(); |