mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-27 04:47:51 +02:00
Switched to a custom logging lib instead of that spdlog junk
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include "sdrpp_server_client.h"
|
||||
#include <imgui.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <utils/flog.h>
|
||||
#include <module.h>
|
||||
#include <gui/gui.h>
|
||||
#include <signal_path/signal_path.h>
|
||||
@ -96,13 +96,13 @@ private:
|
||||
core::setInputSampleRate(_this->client->getSampleRate());
|
||||
}
|
||||
gui::mainWindow.playButtonLocked = !(_this->client && _this->client->isOpen());
|
||||
spdlog::info("SDRPPServerSourceModule '{0}': Menu Select!", _this->name);
|
||||
flog::info("SDRPPServerSourceModule '{0}': Menu Select!", _this->name);
|
||||
}
|
||||
|
||||
static void menuDeselected(void* ctx) {
|
||||
SDRPPServerSourceModule* _this = (SDRPPServerSourceModule*)ctx;
|
||||
gui::mainWindow.playButtonLocked = false;
|
||||
spdlog::info("SDRPPServerSourceModule '{0}': Menu Deselect!", _this->name);
|
||||
flog::info("SDRPPServerSourceModule '{0}': Menu Deselect!", _this->name);
|
||||
}
|
||||
|
||||
static void start(void* ctx) {
|
||||
@ -120,7 +120,7 @@ private:
|
||||
_this->client->start();
|
||||
|
||||
_this->running = true;
|
||||
spdlog::info("SDRPPServerSourceModule '{0}': Start!", _this->name);
|
||||
flog::info("SDRPPServerSourceModule '{0}': Start!", _this->name);
|
||||
}
|
||||
|
||||
static void stop(void* ctx) {
|
||||
@ -130,7 +130,7 @@ private:
|
||||
if (_this->client) { _this->client->stop(); }
|
||||
|
||||
_this->running = false;
|
||||
spdlog::info("SDRPPServerSourceModule '{0}': Stop!", _this->name);
|
||||
flog::info("SDRPPServerSourceModule '{0}': Stop!", _this->name);
|
||||
}
|
||||
|
||||
static void tune(double freq, void* ctx) {
|
||||
@ -139,7 +139,7 @@ private:
|
||||
_this->client->setFrequency(freq);
|
||||
}
|
||||
_this->freq = freq;
|
||||
spdlog::info("SDRPPServerSourceModule '{0}': Tune: {1}!", _this->name, freq);
|
||||
flog::info("SDRPPServerSourceModule '{0}': Tune: {1}!", _this->name, freq);
|
||||
}
|
||||
|
||||
static void menuHandler(void* ctx) {
|
||||
@ -234,7 +234,7 @@ private:
|
||||
deviceInit();
|
||||
}
|
||||
catch (std::exception e) {
|
||||
spdlog::error("Could not connect to SDR: {0}", e.what());
|
||||
flog::error("Could not connect to SDR: {0}", e.what());
|
||||
if (!strcmp(e.what(), "Server busy")) { serverBusy = true; }
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "sdrpp_server_client.h"
|
||||
#include <volk/volk.h>
|
||||
#include <cstring>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <utils/flog.h>
|
||||
#include <core.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
@ -76,7 +76,7 @@ namespace server {
|
||||
|
||||
// Send
|
||||
if (syncRequired) {
|
||||
spdlog::warn("Action requires resync");
|
||||
flog::warn("Action requires resync");
|
||||
auto waiter = awaitCommandAck(COMMAND_UI_ACTION);
|
||||
sendCommand(COMMAND_UI_ACTION, size);
|
||||
if (waiter->await(PROTOCOL_TIMEOUT_MS)) {
|
||||
@ -84,13 +84,13 @@ namespace server {
|
||||
dl.load(r_cmd_data, r_pkt_hdr->size - sizeof(PacketHeader) - sizeof(CommandHeader));
|
||||
}
|
||||
else {
|
||||
spdlog::error("Timeout out after asking for UI");
|
||||
flog::error("Timeout out after asking for UI");
|
||||
}
|
||||
waiter->handled();
|
||||
spdlog::warn("Resync done");
|
||||
flog::warn("Resync done");
|
||||
}
|
||||
else {
|
||||
spdlog::warn("Action does not require resync");
|
||||
flog::warn("Action does not require resync");
|
||||
sendCommand(COMMAND_UI_ACTION, size);
|
||||
}
|
||||
}
|
||||
@ -166,7 +166,7 @@ namespace server {
|
||||
core::setInputSampleRate(_this->currentSampleRate);
|
||||
}
|
||||
else if (_this->r_cmd_hdr->cmd == COMMAND_DISCONNECT) {
|
||||
spdlog::error("Asked to disconnect by the server");
|
||||
flog::error("Asked to disconnect by the server");
|
||||
_this->serverBusy = true;
|
||||
|
||||
// Cancel waiters
|
||||
@ -207,10 +207,10 @@ namespace server {
|
||||
if (outCount) { _this->decompIn.swap(outCount); };
|
||||
}
|
||||
else if (_this->r_pkt_hdr->type == PACKET_TYPE_ERROR) {
|
||||
spdlog::error("SDR++ Server Error: {0}", buf[sizeof(PacketHeader)]);
|
||||
flog::error("SDR++ Server Error: {0}", buf[sizeof(PacketHeader)]);
|
||||
}
|
||||
else {
|
||||
spdlog::error("Invalid packet type: {0}", _this->r_pkt_hdr->type);
|
||||
flog::error("Invalid packet type: {0}", _this->r_pkt_hdr->type);
|
||||
}
|
||||
|
||||
// Restart an async read
|
||||
@ -225,7 +225,7 @@ namespace server {
|
||||
dl.load(r_cmd_data, r_pkt_hdr->size - sizeof(PacketHeader) - sizeof(CommandHeader));
|
||||
}
|
||||
else {
|
||||
if (!serverBusy) { spdlog::error("Timeout out after asking for UI"); };
|
||||
if (!serverBusy) { flog::error("Timeout out after asking for UI"); };
|
||||
waiter->handled();
|
||||
return serverBusy ? -2 : -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user