summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tobias.klauser@uzh.ch>2013-02-22 16:28:11 +0100
committerTobias Klauser <tobias.klauser@uzh.ch>2013-02-22 16:28:11 +0100
commit4b64fef4c41ae4432eb00b8b814ed4d4d746f794 (patch)
tree6fcf6fa13f946de4f0ab641a46ef684d2f1726be
parent97b46a1192352c564eabb841c21ad1284ad1d51b (diff)
Logger: Add warn() method
-rw-r--r--Logger.cpp12
-rw-r--r--Logger.h1
2 files changed, 13 insertions, 0 deletions
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) { }