From 4562171205ec2bf06ba1d70c7b9717b5fc12bb5c Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 24 Jan 2023 15:19:44 -0500 Subject: [PATCH] Logging macros now print new line even if the supplied string does not include one. this is done because the use of macros does not support complex line outputs and therefore there will never be a case where \n is not desired. --- include/blt/std/logging.h | 11 +++++++++-- src/tests/main.cpp | 7 ------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/blt/std/logging.h b/include/blt/std/logging.h index d050942..03fd466 100644 --- a/include/blt/std/logging.h +++ b/include/blt/std/logging.h @@ -56,7 +56,7 @@ namespace blt::logging { #define BLT_ERROR_LN(format, args...) #define BLT_FATAL_LN(format, args...) #else - #define BLT_TRACE(format, ...) log(format, blt::logging::TRACE, false, ##__VA_ARGS__); + /*#define BLT_TRACE(format, ...) log(format, blt::logging::TRACE, false, ##__VA_ARGS__); #define BLT_DEBUG(format, ...) log(format, blt::logging::DEBUG, false, ##__VA_ARGS__); #define BLT_INFO(format, ...) log(format, blt::logging::INFO, false, ##__VA_ARGS__); #define BLT_WARN(format, ...) log(format, blt::logging::WARN, false, ##__VA_ARGS__); @@ -68,7 +68,14 @@ namespace blt::logging { #define BLT_INFO_LN(format, ...) log(format, blt::logging::INFO, true, ##__VA_ARGS__); #define BLT_WARN_LN(format, ...) log(format, blt::logging::WARN, true, ##__VA_ARGS__); #define BLT_ERROR_LN(format, ...) log(format, blt::logging::ERROR, true, ##__VA_ARGS__); - #define BLT_FATAL_LN(format, ...) log(format, blt::logging::FATAL, true, ##__VA_ARGS__); + #define BLT_FATAL_LN(format, ...) log(format, blt::logging::FATAL, true, ##__VA_ARGS__);*/ + + #define BLT_TRACE(format, ...) log(format, blt::logging::TRACE, true, ##__VA_ARGS__); + #define BLT_DEBUG(format, ...) log(format, blt::logging::DEBUG, true, ##__VA_ARGS__); + #define BLT_INFO(format, ...) log(format, blt::logging::INFO, true, ##__VA_ARGS__); + #define BLT_WARN(format, ...) log(format, blt::logging::WARN, true, ##__VA_ARGS__); + #define BLT_ERROR(format, ...) log(format, blt::logging::ERROR, true, ##__VA_ARGS__); + #define BLT_FATAL(format, ...) log(format, blt::logging::FATAL, true, ##__VA_ARGS__); #endif #endif //BLT_TESTS_LOGGING_H diff --git a/src/tests/main.cpp b/src/tests/main.cpp index 45616b7..eb32fff 100644 --- a/src/tests/main.cpp +++ b/src/tests/main.cpp @@ -19,13 +19,6 @@ int main() { BLT_ERROR("Hello World!\n"); BLT_FATAL("Hello World!\n"); - BLT_TRACE_LN("Goodbye World!\n"); - BLT_DEBUG_LN("Goodbye World!\n"); - BLT_INFO_LN("Goodbye World!\n"); - BLT_WARN_LN("Goodbye World!"); - BLT_ERROR_LN("Goodbye World!"); - BLT_FATAL_LN("Goodbye World!"); - std::string hello = "superSexyMax"; std::cout << "String starts with: " << blt::string::contains(hello, "superSexyMaxE") << "\n";