Switched to a custom logging lib instead of that spdlog junk

This commit is contained in:
AlexandreRouma
2023-02-25 18:12:34 +01:00
parent 7e80bbd02c
commit 7723d15e8f
154 changed files with 723 additions and 19918 deletions

View File

@ -1,5 +1,5 @@
#include "spectran_http_client.h"
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <module.h>
#include <gui/gui.h>
#include <signal_path/signal_path.h>
@ -67,13 +67,13 @@ private:
static void menuSelected(void* ctx) {
SpectranHTTPSourceModule* _this = (SpectranHTTPSourceModule*)ctx;
core::setInputSampleRate(_this->sampleRate);
spdlog::info("SpectranHTTPSourceModule '{0}': Menu Select!", _this->name);
flog::info("SpectranHTTPSourceModule '{0}': Menu Select!", _this->name);
}
static void menuDeselected(void* ctx) {
SpectranHTTPSourceModule* _this = (SpectranHTTPSourceModule*)ctx;
gui::mainWindow.playButtonLocked = false;
spdlog::info("SpectranHTTPSourceModule '{0}': Menu Deselect!", _this->name);
flog::info("SpectranHTTPSourceModule '{0}': Menu Deselect!", _this->name);
}
static void start(void* ctx) {
@ -87,7 +87,7 @@ private:
// TODO: Set options
_this->running = true;
spdlog::info("SpectranHTTPSourceModule '{0}': Start!", _this->name);
flog::info("SpectranHTTPSourceModule '{0}': Start!", _this->name);
}
static void stop(void* ctx) {
@ -98,7 +98,7 @@ private:
// TODO: Implement stop
_this->client->streaming(false);
spdlog::info("SpectranHTTPSourceModule '{0}': Stop!", _this->name);
flog::info("SpectranHTTPSourceModule '{0}': Stop!", _this->name);
}
static void tune(double freq, void* ctx) {
@ -107,7 +107,7 @@ private:
// TODO
}
_this->freq = freq;
spdlog::info("SpectranHTTPSourceModule '{0}': Tune: {1}!", _this->name, freq);
flog::info("SpectranHTTPSourceModule '{0}': Tune: {1}!", _this->name, freq);
}
static void menuHandler(void* ctx) {
@ -157,7 +157,7 @@ private:
client = std::make_shared<SpectranHTTPClient>(hostname, port, &stream);
}
catch (std::runtime_error e) {
spdlog::error("Could not connect: {0}", e.what());
flog::error("Could not connect: {0}", e.what());
}
}

View File

@ -1,5 +1,5 @@
#include "spectran_http_client.h"
#include <spdlog/spdlog.h>
#include <utils/flog.h>
SpectranHTTPClient::SpectranHTTPClient(std::string host, int port, dsp::stream<dsp::complex_t>* stream) {
this->stream = stream;
@ -48,7 +48,7 @@ void SpectranHTTPClient::worker() {
std::string jsonData;
int jlen = sock->recvline(jsonData, clen, 5000);
if (jlen <= 0) {
spdlog::error("Couldn't read JSON metadata");
flog::error("Couldn't read JSON metadata");
return;
}
@ -56,7 +56,7 @@ void SpectranHTTPClient::worker() {
uint8_t rs;
int rslen = sock->recv(&rs, 1, true, 5000);
if (rslen != 1 || rs != 0x1E) {
spdlog::error("Missing record separator");
flog::error("Missing record separator");
return;
}
@ -66,7 +66,7 @@ void SpectranHTTPClient::worker() {
for (int i = jlen + 1; i < clen;) {
int read = sock->recv(&buf[sampLen], clen - i, true);
if (read <= 0) {
spdlog::error("Recv failed while reading data");
flog::error("Recv failed while reading data");
return;
}
i += read;
@ -82,7 +82,7 @@ void SpectranHTTPClient::worker() {
std::string dummy;
sock->recvline(dummy, 2);
if (dummy != "\r") {
spdlog::error("Missing trailing CRLF");
flog::error("Missing trailing CRLF");
return;
}
}