Add logging to compat
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 2 Jun 2017 17:43:18 +0000 (13:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Jun 2017 15:51:01 +0000 (11:51 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
compat/Makefile.am
compat/compat_mman.c
compat/compat_uuid.c
compat/logging.c [new file with mode: 0644]
compat/logging.h [new file with mode: 0644]

index bf79838a8a786d6dbf7fd96f2ebda2479f42a74e..ebd4e563685c9432a64e487027803e6124f35042 100644 (file)
@@ -3,7 +3,8 @@ AM_CFLAGS = $(PACKAGE_CFLAGS) -I$(top_srcdir)/include
 noinst_LTLIBRARIES = libcompat.la
 
 libcompat_la_SOURCES = compat_uuid.c \
-                       compat_mman.c
+               compat_mman.c \
+               logging.c logging.h
 
 libcompat_la_LDFLAGS = \
        $(LD_NO_AS_NEEDED)
index 8b874cef4110e3aab75d414510adccb4b8fa73db..58be70ae304a0332f5d11b889e3bf48ff5c857f4 100644 (file)
@@ -26,6 +26,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "COMPAT-MMAN"
+#include "logging.h"
+
 #ifdef __MINGW32__
 
 #include <assert.h>
index 94511d3147b626d42e000b11aa952d72fa8e8564..e495af1cbe2d01ec5849d971d91267d60c24fd6e 100644 (file)
@@ -22,6 +22,9 @@
  * SOFTWARE.
  */
 
+#define BT_LOG_TAG "COMPAT-UUID"
+#include "logging.h"
+
 #ifdef __MINGW32__
 
 #include <rpc.h>
diff --git a/compat/logging.c b/compat/logging.c
new file mode 100644 (file)
index 0000000..b982a4b
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2017 Michael Jeanson <mjeanson@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define BT_LOG_OUTPUT_LEVEL bt_compat_log_level
+#include <babeltrace/logging-internal.h>
+
+BT_LOG_INIT_LOG_LEVEL(bt_compat_log_level, "BABELTRACE_COMPAT_LOG_LEVEL");
diff --git a/compat/logging.h b/compat/logging.h
new file mode 100644 (file)
index 0000000..0c2518e
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef COMPAT_LOGGING_H
+#define COMPAT_LOGGING_H
+
+/*
+ * Copyright (c) 2017 Michael Jeanson <mjeanson@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#define BT_LOG_OUTPUT_LEVEL bt_compat_log_level
+#include <babeltrace/logging-internal.h>
+
+BT_LOG_LEVEL_EXTERN_SYMBOL(bt_compat_log_level);
+
+#endif /* COMPAT_LOGGING_H */
This page took 0.026059 seconds and 4 git commands to generate.