From 356a166b19a154c492dab36fcef313eb0a4387bb Mon Sep 17 00:00:00 2001 From: staviq Date: Wed, 23 Aug 2023 16:06:46 +0200 Subject: [PATCH] reverted log auto endline to better mimic printf --- common/log.h | 4 ++-- examples/main/main.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/common/log.h b/common/log.h index 7ea031d02..0e2e9cd47 100644 --- a/common/log.h +++ b/common/log.h @@ -92,8 +92,8 @@ // This us a trick to bypass the silly // "warning: ISO C++11 requires at least one argument for the "..." in a variadic macro" -// so we xan gave a single macro which can be called just like printf. -#define LOG(...) _LOG(__VA_ARGS__, '\n') +// so we can gave a single macro which can be called just like printf. +#define LOG(...) _LOG(__VA_ARGS__, '\0') inline FILE *log_handler(std::string s = "llama.log") { diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 4d504cd78..aee4b2809 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -61,7 +61,8 @@ void sigint_handler(int signo) { int main(int argc, char ** argv) { gpt_params params; - LOG("Hello World!") + LOG("Hello World!\n") + LOG("Hello Again!\n") if (gpt_params_parse(argc, argv, params) == false) { return 1;