From 9928a3599ef85498a3364bcbf69a6c817f3cb2d8 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sat, 18 Feb 2023 13:49:50 +0100 Subject: [PATCH] include/Spectre/System/Log.h: Change message variable name to format. --- include/Spectre/System/Log.h | 8 ++++---- source/System/Log.cpp | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/Spectre/System/Log.h b/include/Spectre/System/Log.h index 6908134..51c0e14 100644 --- a/include/Spectre/System/Log.h +++ b/include/Spectre/System/Log.h @@ -18,13 +18,13 @@ public : T_DEBUG = 1 << 3 }; - static void info(const char *message, ...); + static void info(const char *format, ...); - static void warn(const char *message, ...); + static void warn(const char *format, ...); - static int error(const char *message, ...); + static int error(const char *format, ...); - static void debug(const char *message, ...); + static void debug(const char *format, ...); private : diff --git a/source/System/Log.cpp b/source/System/Log.cpp index 47a5210..52bfe92 100644 --- a/source/System/Log.cpp +++ b/source/System/Log.cpp @@ -6,47 +6,47 @@ namespace sp { -void Log::info(const char *message, ...) { +void Log::info(const char *format, ...) { va_list vl; - va_start(vl, message); - writeln(T_INFO, message, vl); + va_start(vl, format); + writeln(T_INFO, format, vl); va_end(vl); } -void Log::warn(const char *message, ...) +void Log::warn(const char *format, ...) { va_list vl; - va_start(vl, message); - writeln(T_WARNING, message, vl); + va_start(vl, format); + writeln(T_WARNING, format, vl); va_end(vl); } -int Log::error(const char *message, ...) +int Log::error(const char *format, ...) { va_list vl; - va_start(vl, message); - writeln(T_ERROR, message, vl); + va_start(vl, format); + writeln(T_ERROR, format, vl); va_end(vl); return 1; } -void Log::debug(const char *message, ...) +void Log::debug(const char *format, ...) { #ifdef SPECTRE_DEBUG va_list vl; - va_start(vl, message); - writeln(T_DEBUG, message, vl); + va_start(vl, format); + writeln(T_DEBUG, format, vl); va_end(vl); #endif /* SPECTRE_DEBUG */ } -void Log::writeln(Type type, const char *message, va_list args) +void Log::writeln(Type type, const char *format, va_list args) { FILE *fd = stderr; static char buf[4096]; @@ -73,7 +73,7 @@ void Log::writeln(Type type, const char *message, va_list args) break; } - vsnprintf(buf, sizeof(buf), message, args); + vsnprintf(buf, sizeof(buf), format, args); fprintf(fd, "%s: %s\n", prefix, buf); }