summaryrefslogtreecommitdiff
path: root/android/log.c
diff options
context:
space:
mode:
authorFrederic Danis <frederic.danis@linux.intel.com>2013-10-04 14:48:47 +0300
committerJohan Hedberg <johan.hedberg@intel.com>2013-10-04 15:25:40 +0300
commitf3d3c663201bd2ffc3f75d6cf57bc4ff3542b8ed (patch)
tree9f6fb77c0b658f43e7c99b5e38aa7bd3bc9a06e4 /android/log.c
parenteaed4c15527f2e0169ec25c512019f31ce29a7e2 (diff)
downloadbluez-f3d3c663201bd2ffc3f75d6cf57bc4ff3542b8ed.tar.gz
android: Android version of log.c
Add logging for Android, currently print logs to stderr and stdout.
Diffstat (limited to 'android/log.c')
-rw-r--r--android/log.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/android/log.c b/android/log.c
new file mode 100644
index 000000000..ce07b82c3
--- /dev/null
+++ b/android/log.c
@@ -0,0 +1,82 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2013 Intel Corporation. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <sys/uio.h>
+
+#include <glib.h>
+
+void info(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stdout, format, ap);
+ fprintf(stdout, "\n");
+
+ va_end(ap);
+}
+
+void warn(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
+
+void error(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+
+ va_end(ap);
+}
+
+void btd_debug(const char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+
+ vfprintf(stdout, format, ap);
+ fprintf(stdout, "\n");
+
+ va_end(ap);
+}