From 4d10ad6c32340f6e46f352516f8a2bc2a8dc0ee3 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 16 Nov 2017 04:48:08 -0500 Subject: [PATCH] Add debug() to the logger --- include/util.hpp | 1 + src/util.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/util.hpp b/include/util.hpp index cb6dc007..f7e4732a 100644 --- a/include/util.hpp +++ b/include/util.hpp @@ -132,6 +132,7 @@ struct VIPLock { //////////////////// extern FILE *gLogFile; +void debug(const char *format, ...); void info(const char *format, ...); void warn(const char *format, ...); void fatal(const char *format, ...); diff --git a/src/util.cpp b/src/util.cpp index 8412b3d8..e01c10a9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -161,6 +161,15 @@ void openBrowser(std::string url) { FILE *gLogFile = stderr; +void debug(const char *format, ...) { + va_list args; + va_start(args, format); + fprintf(gLogFile, "[debug] "); + vfprintf(gLogFile, format, args); + fprintf(gLogFile, "\n"); + va_end(args); +} + void info(const char *format, ...) { va_list args; va_start(args, format); @@ -173,7 +182,7 @@ void info(const char *format, ...) { void warn(const char *format, ...) { va_list args; va_start(args, format); - fprintf(gLogFile, "[warn] "); + fprintf(gLogFile, "[warning] "); vfprintf(gLogFile, format, args); fprintf(gLogFile, "\n"); va_end(args);