From 41432143fd945bf31835aa224ba9867338940ac6 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Tue, 5 May 2020 00:14:41 -0400 Subject: [PATCH] Only use lm service when LOGVISOR_NX_LM set --- include/logvisor/logvisor.hpp | 4 ++++ lib/logvisor.cpp | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/logvisor/logvisor.hpp b/include/logvisor/logvisor.hpp index 9d6a099..922748d 100644 --- a/include/logvisor/logvisor.hpp +++ b/include/logvisor/logvisor.hpp @@ -12,6 +12,10 @@ #define FMT_ENFORCE_COMPILE_STRING 1 #include +#if defined(__SWITCH__) && !defined(LOGVISOR_NX_LM) +#define LOGVISOR_NX_LM 0 +#endif + extern "C" void logvisorBp(); namespace logvisor { diff --git a/lib/logvisor.cpp b/lib/logvisor.cpp index e33e9f1..859a475 100644 --- a/lib/logvisor.cpp +++ b/lib/logvisor.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "logvisor/logvisor.hpp" /* ANSI sequences */ @@ -169,6 +169,7 @@ void KillProcessTree() { #elif defined(__SWITCH__) [[noreturn]] void logvisorAbort() { MainLoggers.clear(); + nvExit(); exit(1); } #else @@ -294,7 +295,7 @@ static inline int ConsoleWidth() { return retval; } -#ifdef __SWITCH__ +#if LOGVISOR_NX_LM struct ConsoleLogger : public ILogger { Service m_svc{};