From 394dff9cc4c31ea29867c5e2507edc831a34c19b Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Mon, 22 Jul 2024 20:27:50 -0400 Subject: [PATCH] newline in logger --- CMakeLists.txt | 2 +- include/blt/std/logging.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2506a14..98ae500 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.20) include(cmake/color.cmake) -set(BLT_VERSION 0.18.12) +set(BLT_VERSION 0.18.13) set(BLT_TEST_VERSION 0.0.1) set(BLT_TARGET BLT) diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h index a4b3728..ad1bdd5 100644 --- a/include/blt/std/logging.h +++ b/include/blt/std/logging.h @@ -172,6 +172,8 @@ namespace blt::logging void flush(); + void newline(); + void setThreadName(const std::string& name); void setLogFormat(const log_format& format); @@ -676,6 +678,11 @@ namespace blt::logging { std::cout.flush(); } + void newline() + { + std::cout << std::endl; + } + } #endif @@ -705,6 +712,7 @@ namespace blt::logging { #define BLT_ERROR(format, ...) #define BLT_FATAL(format, ...) #else + #define BLT_NEWLINE() blt::logging::newline() #define BLT_LOG(format, level, ...) blt::logging::log(format, level, __FILE__, __LINE__, ##__VA_ARGS__) #define BLT_LOG_STREAM(level) blt::logging::logger{level, __FILE__, __LINE__} #ifdef BLT_DISABLE_TRACE