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.
v1
Brett 2023-01-24 15:19:44 -05:00
parent 6816ddaf7a
commit 4562171205
2 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -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";