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

@ -47,10 +47,10 @@ namespace backend {
void handleAppCmd(struct android_app* app, int32_t appCmd) {
switch (appCmd) {
case APP_CMD_SAVE_STATE:
spdlog::warn("APP_CMD_SAVE_STATE");
flog::warn("APP_CMD_SAVE_STATE");
break;
case APP_CMD_INIT_WINDOW:
spdlog::warn("APP_CMD_INIT_WINDOW");
flog::warn("APP_CMD_INIT_WINDOW");
if (pauseRendering && !exited) {
doPartialInit();
pauseRendering = false;
@ -58,15 +58,15 @@ namespace backend {
exited = false;
break;
case APP_CMD_TERM_WINDOW:
spdlog::warn("APP_CMD_TERM_WINDOW");
flog::warn("APP_CMD_TERM_WINDOW");
pauseRendering = true;
backend::end();
break;
case APP_CMD_GAINED_FOCUS:
spdlog::warn("APP_CMD_GAINED_FOCUS");
flog::warn("APP_CMD_GAINED_FOCUS");
break;
case APP_CMD_LOST_FOCUS:
spdlog::warn("APP_CMD_LOST_FOCUS");
flog::warn("APP_CMD_LOST_FOCUS");
break;
}
}
@ -77,7 +77,7 @@ namespace backend {
int aquireWindow() {
while (!app->window) {
spdlog::warn("Waiting on the shitty window thing"); std::this_thread::sleep_for(std::chrono::milliseconds(30));
flog::warn("Waiting on the shitty window thing"); std::this_thread::sleep_for(std::chrono::milliseconds(30));
int out_events;
struct android_poll_source* out_data;
@ -96,7 +96,7 @@ namespace backend {
}
int init(std::string resDir) {
spdlog::warn("Backend init");
flog::warn("Backend init");
// Get window
aquireWindow();
@ -174,7 +174,7 @@ namespace backend {
void setMouseScreenPos(double x, double y) {}
int renderLoop() {
spdlog::warn("BRUH: {0}", (void*)backend::app->window);
flog::warn("BRUH: {0}", (void*)backend::app->window);
while (true) {
int out_events;
struct android_poll_source* out_data;
@ -185,7 +185,7 @@ namespace backend {
// Exit the app by returning from within the infinite loop
if (app->destroyRequested != 0) {
spdlog::warn("ASKED TO EXIT");
flog::warn("ASKED TO EXIT");
exited = true;
// Stop SDR
@ -465,7 +465,7 @@ extern "C" {
// Check if this is the first time we run or not
if (backend::initialized) {
spdlog::warn("android_main called again");
flog::warn("android_main called again");
backend::doPartialInit();
backend::pauseRendering = false;
backend::renderLoop();
@ -474,9 +474,9 @@ extern "C" {
backend::initialized = true;
// prepare spdlog
auto console_sink = std::make_shared<spdlog::sinks::android_sink_st>("SDR++");
auto logger = std::shared_ptr<spdlog::logger>(new spdlog::logger("", { console_sink }));
spdlog::set_default_logger(logger);
auto console_sink = std::make_shared<flog::sinks::android_sink_st>("SDR++");
auto logger = std::shared_ptr<flog::logger>(new flog::logger("", { console_sink }));
flog::set_default_logger(logger);
// Grab files dir
std::string appdir = backend::getAppFilesDir();