Remove dependency of libmm-log, rather have dlog dependency 78/150078/1
authorSangchul Lee <sc11.lee@samsung.com>
Thu, 14 Sep 2017 07:21:10 +0000 (16:21 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Thu, 14 Sep 2017 07:42:23 +0000 (16:42 +0900)
Adopt mm_log.h file from libmm-log(commitId:8f699489c8792ec401ad8726108153d3d58fc106).

[Version] 0.2.106
[Issue Type] Dependency

Change-Id: I3dba55f0e7fa008dfe8a1da9fa3cf081aceea360
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
Makefile.am
configure.ac
include/mm_debug.h
include/mm_log.h [new file with mode: 0644]
mm-common.pc.in
packaging/libmm-common.spec

index 9288242..68f4d13 100644 (file)
@@ -6,6 +6,7 @@ includelibmmfcommon_HEADERS = include/mm_attrs.h \
                              include/mm_message.h \
                              include/mm_types.h \
                              include/mm_debug.h \
+                             include/mm_log.h \
                              include/mm.h \
                              include/mm_attrs_private.h
 
@@ -14,13 +15,14 @@ libmmfcommon_la_SOURCES = mm_attrs.c \
                          mm_list_private.c
 
 libmmfcommon_la_CFLAGS = -I$(srcdir)/include \
-                        $(GLIB_CFLAGS)
+                        $(GLIB_CFLAGS) \
+                        $(DLOG_CFLAGS)
 
 libmmfcommon_la_LIBADD = -lpthread \
-                        $(GLIB_LIBS)
+                        $(GLIB_LIBS) \
+                        $(DLOG_LIBS)
 
-libmmfcommon_la_CFLAGS += $(MMLOG_CFLAGS) -DMMF_LOG_OWNER=0x200 -DMMF_DEBUG_PREFIX=\"MMF-COMMON\"
-libmmfcommon_la_LIBADD += $(MMLOG_LIBS)
+libmmfcommon_la_CFLAGS += -DMMF_LOG_OWNER=0x200 -DMMF_DEBUG_PREFIX=\"MMF-COMMON\"
 
 installspecdir = $(includedir)/mmf
 
index d86729b..a74890e 100644 (file)
@@ -32,9 +32,9 @@ PKG_CHECK_MODULES(GLIB, glib-2.0)
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
-PKG_CHECK_MODULES(MMLOG,mm-log)
-AC_SUBST(MMLOG_CFLAGS)
-AC_SUBST(MMLOG_LIBS)
+PKG_CHECK_MODULES(DLOG, dlog)
+AC_SUBST(DLOG_CFLAGS)
+AC_SUBST(DLOG_LIBS)
 
 AC_CONFIG_FILES([Makefile
                 mm-common.pc
index 818b8ba..b0c7fbb 100644 (file)
@@ -91,7 +91,7 @@ enum {
 /*
  *     LOG MANAGER
  */
-#include <mm_log.h>
+#include "mm_log.h"
 
 /******************************************************************************
  *
diff --git a/include/mm_log.h b/include/mm_log.h
new file mode 100644 (file)
index 0000000..52d6e05
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * libmm-log
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Sangchul Lee <sc11.lee@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#ifndef __MM_LOG_H__
+#define  __MM_LOG_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Enumerations for log direction
+ */
+typedef enum  {
+       LOG_DIRECTION_NONE = 0,
+       LOG_DIRECTION_CONSOLE,
+       LOG_DIRECTION_FILE,
+       LOG_DIRECTION_SYSLOG,
+       LOG_DIRECTION_SYSTEM,
+       LOG_DIRECTION_VIEWER,
+       LOG_DIRECTION_CNT,
+} log_direction_t;
+
+/**
+ * Enumerations for log owner
+ */
+typedef enum {
+       LOG_NONE       = 0x00000000,
+       LOG_AVSYSTEM    = 0x00000001,
+       LOG_SOUNDSERVER = 0x00000002,
+       LOG_FOCUSSERVER = 0x00000004,
+       LOG_PLAYER     = 0x00000008,
+       LOG_CAMCORDER  = 0x00000010,
+       LOG_SOUND      = 0x00000020,
+       LOG_FILEINFO       = 0x00000040,
+       LOG_UTILITY      = 0x00000100,
+       LOG_COMMON     = 0x00000200,
+       LOG_MEDIA_CALL  = 0x00080000,
+       LOG_SESSION = 0x00100000,
+       LOG_RADIO          = 0x00200000,
+       LOG_TRANSCODE   = 0x00300000,
+       LOG_STRRECORDER = 0x00400000,
+       LOG_SESSIONMGR = 0x00800000,
+       LOG_MIRACAST = 0x01000000,
+       LOG_WFD = 0x02000000,
+       LOG_JPEG_MSM8974 = 0x03000000,
+       LOG_UCM = 0x04000000,
+       LOG_ALL        = 0xFFFFFFFF,
+} log_owner_t;
+
+/**
+ * Enumerations for log class
+ */
+typedef enum {
+       LOG_CLASS_NONE      = 0x00,
+       LOG_CLASS_VERBOSE   = 0x01,
+       LOG_CLASS_DEBUG     = 0x02,
+       LOG_CLASS_INFO      = 0x04,
+       LOG_CLASS_WARNING   = 0x08,
+       LOG_CLASS_ERR       = 0x10,
+       LOG_CLASS_CRITICAL  = 0x20,
+       LOG_CLASS_ALL       = 0xFF,
+} log_class_t;
+
+#if defined(MM_DEBUG_FLAG)
+/**
+ * This function print log.
+ *
+ * @param   owner       [in]    owner of log message.
+ * @param   class       [in]    class of log message.
+ * @param   msg         [in]    message to print.
+ *
+ * @remark  Print log message. Similar to printf except owner and class.
+ * @see     log_print_rel
+ */
+#define log_print_dbg(owner, class, msg, args...) log_print_rel(owner, class, msg, ##args)
+
+/**
+ * This function assert condition.
+ *
+ * @param   condition       [in]    condition for check
+ *
+ * @remark  If condition is not true, system is aborted. Same to assert function.
+ * @see     log_assert_rel
+ */
+#define log_assert_dbg(condition)  log_assert_rel((condition))
+
+#else
+#define log_print_dbg(owner, class, msg, args...)
+#define log_assert_dbg(condition)
+#endif
+
+#define _SLOG(class, tag, format, arg...) \
+       SLOG(class, tag, format, ##arg)
+
+#define _SECURE_SLOG(class, tag, format, arg...) \
+       SECURE_SLOG(class, tag, format, ##arg)
+
+#include <dlog.h>
+
+#define mm_log_by_owner(owner, class, msg, args...) \
+       do { \
+               switch (owner) { \
+               case LOG_AVSYSTEM: _SLOG(class, "AVSYSTEM", msg, ##args); break; \
+               case LOG_SOUNDSERVER: _SLOG(class, "SOUND_SERVER", msg, ##args); break; \
+               case LOG_FOCUSSERVER: _SLOG(class, "FOCUS_SERVER", msg, ##args); break; \
+               case LOG_PLAYER: _SLOG(class, "MM_PLAYER", msg, ##args); break; \
+               case LOG_CAMCORDER: _SLOG(class, "MM_CAMCORDER", msg, ##args); break; \
+               case LOG_SOUND: _SLOG(class, "MM_SOUND", msg, ##args); break; \
+               case LOG_FILEINFO: _SLOG(class, "MM_FILEINFO", msg, ##args); break; \
+               case LOG_UTILITY: _SLOG(class, "MM_UTILITY", msg, ##args); break; \
+               case LOG_COMMON: _SLOG(class, "MM_COMMON", msg, ##args); break; \
+               case LOG_MEDIA_CALL: _SLOG(class, "MM_MEDIA_CALL", msg, ##args); break; \
+               case LOG_SESSION: _SLOG(class, "MM_SESSION", msg, ##args); break; \
+               case LOG_RADIO: _SLOG(class, "MM_RADIO", msg, ##args); break; \
+               case LOG_TRANSCODE: _SLOG(class, "MM_TRANSCODE", msg, ##args); break; \
+               case LOG_SESSIONMGR: _SLOG(class, "MM_SESSIONMGR", msg, ##args); break; \
+               case LOG_MIRACAST: _SLOG(class, "MM_MIRACAST", msg, ##args); break; \
+               case LOG_WFD: _SLOG(class, "MM_WFD", msg, ##args); break; \
+               case LOG_JPEG_MSM8974: _SLOG(class, "MM_JPEG_MSM8974", msg, ##args); break; \
+               case LOG_STRRECORDER: _SLOG(class, "MM_STREAMRECORDER", msg, ##args); break; \
+               case LOG_UCM: _SLOG(class, "UCM", msg, ##args); break; \
+               default: _SLOG(class, "MM_UNKNOWN", msg, ##args); break; \
+               } \
+       } while (0)
+
+#define mm_secure_log_by_owner(owner, class, msg, args...) \
+       do { \
+               switch (owner) { \
+               case LOG_AVSYSTEM: _SECURE_SLOG(class, "AVSYSTEM", msg, ##args); break; \
+               case LOG_SOUNDSERVER: _SECURE_SLOG(class, "SOUND_SERVER", msg, ##args); break; \
+               case LOG_PLAYER: _SECURE_SLOG(class, "MM_PLAYER", msg, ##args); break; \
+               case LOG_CAMCORDER: _SECURE_SLOG(class, "MM_CAMCORDER", msg, ##args); break; \
+               case LOG_SOUND: _SECURE_SLOG(class, "MM_SOUND", msg, ##args); break; \
+               case LOG_FILEINFO: _SECURE_SLOG(class, "MM_FILEINFO", msg, ##args); break; \
+               case LOG_UTILITY: _SECURE_SLOG(class, "MM_UTILITY", msg, ##args); break; \
+               case LOG_COMMON: _SECURE_SLOG(class, "MM_COMMON", msg, ##args); break; \
+               case LOG_MEDIA_CALL: _SECURE_SLOG(class, "MM_MEDIA_CALL", msg, ##args); break; \
+               case LOG_SESSION: _SECURE_SLOG(class, "MM_SESSION", msg, ##args); break; \
+               case LOG_RADIO: _SECURE_SLOG(class, "MM_RADIO", msg, ##args); break; \
+               case LOG_TRANSCODE: _SECURE_SLOG(class, "MM_TRANSCODE", msg, ##args); break; \
+               case LOG_SESSIONMGR: _SECURE_SLOG(class, "MM_SESSIONMGR", msg, ##args); break; \
+               case LOG_MIRACAST: _SECURE_SLOG(class, "MM_MIRACAST", msg, ##args); break; \
+               case LOG_WFD: _SECURE_SLOG(class, "MM_WFD", msg, ##args); break; \
+               case LOG_STRRECORDER: _SECURE_SLOG(class, "MM_STREAMRECORDER", msg, ##args); break; \
+               case LOG_UCM: _SECURE_SLOG(class, "UCM", msg, ##args); break; \
+               default: _SECURE_SLOG(class, "MM_UNKNOWN", msg, ##args); break; \
+               } \
+       } while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MM_LOG_H__ */
+
index c9c2f95..3fb649a 100644 (file)
@@ -5,7 +5,7 @@ includedir = @includedir@
 
 Name : mm-common
 Description : Multimedia Framework Common Library
-Requires : glib-2.0 mm-log
+Requires : glib-2.0 dlog
 Version : @VERSION@
 Libs : -L${libdir} -lmmfcommon -lpthread
 Cflags : -I${includedir}/mmf
index 51d6d90..4293573 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-common
 Summary:    Multimedia Framework Common Lib
-Version:    0.2.105
+Version:    0.2.106
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
@@ -8,8 +8,7 @@ Source0:    %{name}-%{version}.tar.gz
 Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(mm-log)
-
+BuildRequires:  pkgconfig(dlog)
 
 %description
 Multimedia Framework Common Library
@@ -58,6 +57,7 @@ rm -rf %{buildroot}
 %{_includedir}/mmf/mm_attrs.h
 %{_includedir}/mmf/mm_attrs_private.h
 %{_includedir}/mmf/mm_debug.h
+%{_includedir}/mmf/mm_log.h
 %{_includedir}/mmf/mm.h
 %{_libdir}/pkgconfig/mm-common.pc
 %{_libdir}/libmmfcommon.so