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,7 +1,7 @@
#include "iq_frontend.h"
#include "../dsp/window/blackman.h"
#include "../dsp/window/nuttall.h"
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <gui/gui.h>
#include <core.h>
@ -140,7 +140,7 @@ void IQFrontEnd::unbindIQStream(dsp::stream<dsp::complex_t>* stream) {
dsp::channel::RxVFO* IQFrontEnd::addVFO(std::string name, double sampleRate, double bandwidth, double offset) {
// Make sure no other VFO with that name already exists
if (vfos.find(name) != vfos.end()) {
spdlog::error("[IQFrontEnd] Tried to add VFO with existing name.");
flog::error("[IQFrontEnd] Tried to add VFO with existing name.");
return NULL;
}
@ -162,7 +162,7 @@ dsp::channel::RxVFO* IQFrontEnd::addVFO(std::string name, double sampleRate, dou
void IQFrontEnd::removeVFO(std::string name) {
// Make sure that a VFO with that name exists
if (vfos.find(name) == vfos.end()) {
spdlog::error("[IQFrontEnd] Tried to remove a VFO that doesn't exist.");
flog::error("[IQFrontEnd] Tried to remove a VFO that doesn't exist.");
return;
}

View File

@ -1,5 +1,5 @@
#include <signal_path/sink.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <imgui/imgui.h>
#include <gui/style.h>
#include <gui/icons.h>
@ -87,7 +87,7 @@ void SinkManager::Stream::setSampleRate(float sampleRate) {
void SinkManager::registerSinkProvider(std::string name, SinkProvider provider) {
if (providers.find(name) != providers.end()) {
spdlog::error("Cannot register sink provider '{0}', this name is already taken", name);
flog::error("Cannot register sink provider '{0}', this name is already taken", name);
return;
}
@ -108,7 +108,7 @@ void SinkManager::registerSinkProvider(std::string name, SinkProvider provider)
void SinkManager::unregisterSinkProvider(std::string name) {
if (providers.find(name) == providers.end()) {
spdlog::error("Cannot unregister sink provider '{0}', no such provider exists.", name);
flog::error("Cannot unregister sink provider '{0}', no such provider exists.", name);
return;
}
@ -137,7 +137,7 @@ void SinkManager::unregisterSinkProvider(std::string name) {
void SinkManager::registerStream(std::string name, SinkManager::Stream* stream) {
if (streams.find(name) != streams.end()) {
spdlog::error("Cannot register stream '{0}', this name is already taken", name);
flog::error("Cannot register stream '{0}', this name is already taken", name);
return;
}
@ -163,7 +163,7 @@ void SinkManager::registerStream(std::string name, SinkManager::Stream* stream)
void SinkManager::unregisterStream(std::string name) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot unregister stream '{0}', this stream doesn't exist", name);
flog::error("Cannot unregister stream '{0}', this stream doesn't exist", name);
return;
}
onStreamUnregister.emit(name);
@ -177,7 +177,7 @@ void SinkManager::unregisterStream(std::string name) {
void SinkManager::startStream(std::string name) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot start stream '{0}', this stream doesn't exist", name);
flog::error("Cannot start stream '{0}', this stream doesn't exist", name);
return;
}
streams[name]->start();
@ -185,7 +185,7 @@ void SinkManager::startStream(std::string name) {
void SinkManager::stopStream(std::string name) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot stop stream '{0}', this stream doesn't exist", name);
flog::error("Cannot stop stream '{0}', this stream doesn't exist", name);
return;
}
streams[name]->stop();
@ -193,7 +193,7 @@ void SinkManager::stopStream(std::string name) {
float SinkManager::getStreamSampleRate(std::string name) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot get sample rate of stream '{0}', this stream doesn't exist", name);
flog::error("Cannot get sample rate of stream '{0}', this stream doesn't exist", name);
return -1.0f;
}
return streams[name]->getSampleRate();
@ -201,7 +201,7 @@ float SinkManager::getStreamSampleRate(std::string name) {
dsp::stream<dsp::stereo_t>* SinkManager::bindStream(std::string name) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot bind to stream '{0}'. Stream doesn't exist", name);
flog::error("Cannot bind to stream '{0}'. Stream doesn't exist", name);
return NULL;
}
return streams[name]->bindStream();
@ -209,7 +209,7 @@ dsp::stream<dsp::stereo_t>* SinkManager::bindStream(std::string name) {
void SinkManager::unbindStream(std::string name, dsp::stream<dsp::stereo_t>* stream) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot unbind from stream '{0}'. Stream doesn't exist", name);
flog::error("Cannot unbind from stream '{0}'. Stream doesn't exist", name);
return;
}
streams[name]->unbindStream(stream);
@ -217,12 +217,12 @@ void SinkManager::unbindStream(std::string name, dsp::stream<dsp::stereo_t>* str
void SinkManager::setStreamSink(std::string name, std::string providerName) {
if (streams.find(name) == streams.end()) {
spdlog::error("Cannot set sink for stream '{0}'. Stream doesn't exist", name);
flog::error("Cannot set sink for stream '{0}'. Stream doesn't exist", name);
return;
}
Stream* stream = streams[name];
if (providers.find(providerName) == providers.end()) {
spdlog::error("Unknown sink provider '{0}'", providerName);
flog::error("Unknown sink provider '{0}'", providerName);
return;
}

View File

@ -1,6 +1,6 @@
#include <server.h>
#include <signal_path/source.h>
#include <spdlog/spdlog.h>
#include <utils/flog.h>
#include <signal_path/signal_path.h>
#include <core.h>
@ -9,7 +9,7 @@ SourceManager::SourceManager() {
void SourceManager::registerSource(std::string name, SourceHandler* handler) {
if (sources.find(name) != sources.end()) {
spdlog::error("Tried to register new source with existing name: {0}", name);
flog::error("Tried to register new source with existing name: {0}", name);
return;
}
sources[name] = handler;
@ -18,7 +18,7 @@ void SourceManager::registerSource(std::string name, SourceHandler* handler) {
void SourceManager::unregisterSource(std::string name) {
if (sources.find(name) == sources.end()) {
spdlog::error("Tried to unregister non existent source: {0}", name);
flog::error("Tried to unregister non existent source: {0}", name);
return;
}
onSourceUnregister.emit(name);
@ -41,7 +41,7 @@ std::vector<std::string> SourceManager::getSourceNames() {
void SourceManager::selectSource(std::string name) {
if (sources.find(name) == sources.end()) {
spdlog::error("Tried to select non existent source: {0}", name);
flog::error("Tried to select non existent source: {0}", name);
return;
}
if (selectedHandler != NULL) {