spdlog :D

This commit is contained in:
T0b1
2023-06-25 03:19:42 +02:00
parent 10826ff2d5
commit 83fb234d5c
3 changed files with 24 additions and 6 deletions

View File

@@ -19,6 +19,7 @@
#include <cassert>
#include <cstring>
#include <algorithm>
#include <spdlog/spdlog.h>
#include <pthread.h>
@@ -93,15 +94,15 @@ void LLDBBackend::wait_for_debug_events()
if (listener.WaitForEvent(0xFFFFFFFF, event))
{
std::lock_guard g{_data_lock};
printf("Got Event:\n");
spdlog::info("Got Event");
auto stream = lldb::SBStream{};
if (event.GetDescription(stream))
{
printf(" Desc: %.*s\n", static_cast<int>(stream.GetSize()),
stream.GetData());
spdlog::info(" -> Desc: {}",
std::string_view{stream.GetData(), stream.GetSize()});
} else
{
printf(" Failed to get stream\n");
spdlog::warn(" -> Failed to get stream\n");
}
if (SBProcess::EventIsProcessEvent(event))
@@ -115,7 +116,7 @@ void LLDBBackend::wait_for_debug_events()
}
} else
{
printf(" Unknown event source!\n");
spdlog::warn(" -> Unknown event source!\n");
}
}
}

View File

@@ -13,6 +13,8 @@
#define GL_SILENCE_DEPRECATION
#include <GLFW/glfw3.h> // Will drag system OpenGL headers
#include <pthread.h>
#include <spdlog/spdlog.h>
#include <spdlog/cfg/env.h>
#include "frontend/frontend.h"
@@ -24,8 +26,14 @@ static void glfw_error_callback(int error, const char *description)
// Main code
int main(int, char **)
{
spdlog::cfg::load_env_levels();
pthread_setname_np(pthread_self(), "render_thread");
spdlog::info("Welcome to spdlog version {}.{}.{} !", SPDLOG_VER_MAJOR,
SPDLOG_VER_MINOR, SPDLOG_VER_PATCH);
spdlog::info("Starting dbgui...");
glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit())
return 1;