]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/main.c
logging: make libi3 use verboselog()/errorlog(), provide it in each caller
[i3/i3] / i3bar / src / main.c
index 4dc55603ad0f4ac672c02fb47818a7594328b47d..ea6056470c5f05381fc4c1e9efffddb1e3abbb7b 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
  *
  */
 #include <stdio.h>
 
 #include "common.h"
 
+/*
+ * Having verboselog() and errorlog() is necessary when using libi3.
+ *
+ */
+void verboselog(char *fmt, ...) {
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(stdout, fmt, args);
+    va_end(args);
+}
+
+void errorlog(char *fmt, ...) {
+    va_list args;
+
+    va_start(args, fmt);
+    vfprintf(stderr, fmt, args);
+    va_end(args);
+}
+
 /*
  * Glob path, i.e. expand ~
  *
@@ -35,7 +55,7 @@ char *expand_path(char *path) {
 void print_usage(char *elf_name) {
     printf("Usage: %s [-b bar_id] [-s sock_path] [-h] [-v]\n", elf_name);
     printf("\n");
-    printf("-b <bar_id>\tBar ID for which to get the configuration\n");
+    printf("--bar_id <bar_id>\tBar ID for which to get the configuration\n");
     printf("-s <sock_path>\tConnect to i3 via <sock_path>\n");
     printf("-h\t\tDisplay this help-message and exit\n");
     printf("-v\t\tDisplay version number and exit\n");