Add function for printing warnings
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 13 Aug 2009 00:41:55 +0000 (17:41 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 13 Aug 2009 00:41:55 +0000 (17:41 -0700)
include/log.h
src/log.c

index 991e019..0ed8ee2 100644 (file)
@@ -34,6 +34,8 @@ extern "C" {
 
 void connman_info(const char *format, ...)
                                __attribute__((format(printf, 1, 2)));
+void connman_warn(const char *format, ...)
+                               __attribute__((format(printf, 1, 2)));
 void connman_error(const char *format, ...)
                                __attribute__((format(printf, 1, 2)));
 void connman_debug(const char *format, ...)
index 1651f38..dbc3f7c 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -49,6 +49,24 @@ void connman_info(const char *format, ...)
 }
 
 /**
+ * connman_warn:
+ * @format: format string
+ * @Varargs: list of arguments
+ *
+ * Output warning messages
+ */
+void connman_warn(const char *format, ...)
+{
+       va_list ap;
+
+       va_start(ap, format);
+
+       vsyslog(LOG_WARNING, format, ap);
+
+       va_end(ap);
+}
+
+/**
  * connman_error:
  * @format: format string
  * @varargs: list of arguments