From 4b64fef4c41ae4432eb00b8b814ed4d4d746f794 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 22 Feb 2013 16:28:11 +0100 Subject: Logger: Add warn() method --- Logger.cpp | 12 ++++++++++++ Logger.h | 1 + 2 files changed, 13 insertions(+) diff --git a/Logger.cpp b/Logger.cpp index b0850a6..b4f6bbf 100644 --- a/Logger.cpp +++ b/Logger.cpp @@ -45,6 +45,18 @@ int Logger::log(const char *fmt, ...) return ret; } +int Logger::warn(const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start(ap, fmt); + ret = _log_vfprintf(_f_err, "Warning", fmt, ap); + va_end(ap); + + return ret; +} + int Logger::err(const char *fmt, ...) { va_list ap; diff --git a/Logger.h b/Logger.h index 5ee5bd4..85f9f4c 100644 --- a/Logger.h +++ b/Logger.h @@ -25,6 +25,7 @@ public: } int log(const char *fmt, ...); + int warn(const char *fmt, ...); int err(const char *fmt, ...); private: Logger() : _f_out(stdout), _f_err(stderr) { } -- cgit v1.2.3-54-g00ecf