From 13ef940b2de76ac6f6d7bd5d587f1a60d9003cf0 Mon Sep 17 00:00:00 2001 From: NaifBanana <30419422+NaifBanana@users.noreply.github.com> Date: Sat, 2 May 2026 03:37:06 -0500 Subject: [PATCH] Formatting tweaks --- engine/NBCore/src/Logger.cpp | 9 ++++----- engine/NBCore/tests/testLogger.cpp | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/engine/NBCore/src/Logger.cpp b/engine/NBCore/src/Logger.cpp index 795136d..f2d0c8e 100644 --- a/engine/NBCore/src/Logger.cpp +++ b/engine/NBCore/src/Logger.cpp @@ -10,20 +10,19 @@ nb::DefaultDebugLogger logger(std::cout); #endif // _NB_NO_LOGGER bool nb::DefaultDebugLogger::process(const LogEvent& msg) { - constexpr size_t level_field_width = 3; - constexpr size_t msg_prompt_length = level_field_width+6; + constexpr size_t level_field_width = 5; + constexpr size_t msg_prompt_length = level_field_width+7; for (const auto os : this->_ostream) { *os << "["; os->width(level_field_width); - (*os << std::to_string(msg.lvl)).width(level_field_width); - *os << "] :: "; + *os << std::to_string(msg.lvl) << "] :: "; std::string fileloc=""; if (!msg.file.empty()) { fileloc += "(" + msg.file + ":" + std::to_string(msg.line) + ") - "; } *os << indent_strblock( fileloc + msg.msg, - std::string(15 - msg_prompt_length, ' '), + std::string(20 - msg_prompt_length, ' '), "" ) << nb::NEWLINE; } diff --git a/engine/NBCore/tests/testLogger.cpp b/engine/NBCore/tests/testLogger.cpp index 451a01f..27da8da 100644 --- a/engine/NBCore/tests/testLogger.cpp +++ b/engine/NBCore/tests/testLogger.cpp @@ -31,8 +31,8 @@ const nb::ErrorCodeMap TestError::ErrorMessages{ int main() { nb::logger.log("Whoop!"); try { - THROW(nb::Error(1)); - } catch (nb::Error<> e){ + THROW(TestError(0, TestError(1, TestError(2, TestError(3, TestError(2)))))); + } catch (TestError e){ nb::logger.log("nb::Error was thrown!"); } @@ -41,6 +41,6 @@ int main() { } catch (std::exception e){ nb::logger.log("std::exception was thrown!"); } - + ERROR("hello there!"); return 0; } \ No newline at end of file