dlog_includedir = $(includedir)/dlog
dlog_include_HEADERS = \
- include/dlog.h
+ include/dlog.h \
+ include/dlog-internal.h
lib_LTLIBRARIES = libdlog.la
src/libdlog/log.c \
src/shared/logcommon.c \
include/dlog.h \
- include/logcommon.h \
+ include/dlog-internal.h \
src/libdlog/logconfig.c \
include/logconfig.h \
src/libdlog/loglimiter.c \
include/logcommon.h \
include/dlog.h
-include/%: include/%.m4
- m4 -P $(M4_DEFINES) < $< > $@
-
# conf file
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dlog.pc
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
-AC_SUBST(M4_DEFINES)
-M4_DEFINES=
-
# check for libsystemd-journal
AC_ARG_ENABLE(journal, AS_HELP_STRING([--enable-journal], [enable systemd journal]),
[with_systemd_journal=yes],
engineer_mode=no)
if test "x$engineer_mode" = "xyes" ; then
DEBUG_CFLAGS+=" -DTIZEN_ENGINEER_MODE"
- M4_DEFINES="$M4_DEFINES -DTIZEN_ENGINEER_MODE"
fi
AC_ARG_ENABLE([debug_enable],
AS_HELP_STRING([--enable-debug_enable Turn on debug_enable]),
*/
/**
- * @file dlog.h
+ * @file dlog-internal.h
* @version 0.4
* @brief This file is the header file of interface of dlog.
*/
-#ifndef _DLOG_H_
-#define _DLOG_H_
+#ifndef _DLOG_INTERNAL_H_
+#define _DLOG_INTERNAL_H_
#include <tizen_error.h>
#include <stdarg.h>
#define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
#endif
-m4_ifdef(`TIZEN_ENGINEER_MODE',
+#ifdef TIZEN_ENGINEER_MODE
+#ifndef DLOG_DEBUG_ENABLE
#define DLOG_DEBUG_ENABLE
-
-)m4_dnl
-/**
- * @addtogroup CAPI_SYSTEM_DLOG
- * @{
- *
- */
-/**
- * @brief Enumeration for Dlog Error.
- * @since_tizen 2.3
- */
-typedef enum {
- DLOG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- DLOG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */
-} dlog_error_e;
-/**
- * @}
- */
-
-/**
- * @addtogroup CAPI_SYSTEM_DLOG
- * @{
- *
- */
-/**
- * @brief log priority values, in ascending priority order.
- * @since_tizen 2.3
- */
-typedef enum {
- DLOG_UNKNOWN = 0, /**< Keep this always at the start */
- DLOG_DEFAULT, /**< Default */
- DLOG_VERBOSE, /**< Verbose */
- DLOG_DEBUG, /**< Debug */
- DLOG_INFO, /**< Info */
- DLOG_WARN, /**< Warning */
- DLOG_ERROR, /**< Error */
- DLOG_FATAL, /**< Fatal */
- DLOG_SILENT, /**< Silent */
- DLOG_PRIO_MAX /**< Keep this always at the end. */
-} log_priority;
-/**
- * @}
- */
+#endif
+#endif
/**
* @internal
#endif
// ---------------------------------------------------------------------
-/**
- * @addtogroup CAPI_SYSTEM_DLOG
- * @{
- */
-/**
- * @brief Send log with priority and tag.
- * @details for application
- * @since_tizen 2.3
- * @param[in] prio log_priority
- * @param[in] tag tag
- * @param[in] fmt format string
- * @return On success, the function returns the number of bytes written.
- * On error, a negative errno-style error code
- * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
- * @pre none
- * @post none
- * @see dlog_vprint
- * @code
-#include<dlog.h>
-int main(void)
-{
- int integer = 21;
- char string[] = "test dlog";
-
- dlog_print(DLOG_INFO, "USR_TAG", "test dlog");
- dlog_print(DLOG_INFO, "USR_TAG", "%s, %d", string, integer);
- return 0;
-}
- * @endcode
- */
-int dlog_print(log_priority prio, const char *tag, const char *fmt, ...);
-
-/**
- * @brief Send log with priority, tag and va_list.
- * @details for application
- * @since_tizen 2.3
- * @param[in] prio log_priority
- * @param[in] tag tag
- * @param[in] fmt format string
- * @param[in] ap va_list
- * @return On success, the function returns the number of bytes written.
- * On error, a negative errno-style error code
- * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
- * @pre none
- * @post none
- * @see dlog_print
- * @code
-#include<dlog.h>
-void my_debug_print(char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- dlog_vprint(DLOG_INFO, "USR_TAG", format, ap);
- va_end(ap);
-}
-
-int main(void)
-{
- my_debug_print("%s", "test dlog");
- my_debug_print("%s, %d", "test dlog", 21);
- return 0;
-}
- * @endcode
- */
-int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap);
-/**
- * @}
- */
-
-
/*
* The stuff in the rest of this file should not be used directly.
*/
* @see __dlog_print
* @code
#define LOG_TAG USR_TAG
- #include<dlog.h>
+ #include<dlog-internal.h>
__dlog_print(LOG_ID_MAIN, DLOG_INFO, USR_TAG, "you must not use this API directly");
* @endcode
*/
* @see __dlog_vprint
* @code
#define LOG_TAG USR_TAG
- #include<dlog.h>
+ #include<dlog-internal.h>
__dlog_vprint(LOG_ID_MAIN, DLOG_INFO, USR_TAG, "you must not use this API directly", ap);
* @endcode
*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
-#endif /* _DLOG_H_*/
+#endif /* _DLOG_INTERNAL_H_*/
--- /dev/null
+/*
+ * DLOG
+ * Copyright (c) 2005-2008, The Android Open Source Project
+ * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+/**
+ * @file dlog.h
+ * @version 0.4
+ * @brief This file is the header file of interface of dlog.
+ */
+#ifndef _DLOG_H_
+#define _DLOG_H_
+
+#include <tizen_error.h>
+#include <stdarg.h>
+#include <string.h>
+
+#include "dlog-internal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/*
+ * This is the local tag used for the following simplified
+ * logging macros. You can change this preprocessor definition
+ * before using the other macros to change the tag.
+ */
+#ifndef LOG_TAG
+#define LOG_TAG NULL
+#endif
+
+/**
+ * @addtogroup CAPI_SYSTEM_DLOG
+ * @{
+ *
+ */
+/**
+ * @brief Enumeration for Dlog Error.
+ * @since_tizen 2.3
+ */
+typedef enum {
+ DLOG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ DLOG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */
+} dlog_error_e;
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_SYSTEM_DLOG
+ * @{
+ *
+ */
+/**
+ * @brief log priority values, in ascending priority order.
+ * @since_tizen 2.3
+ */
+typedef enum {
+ DLOG_UNKNOWN = 0, /**< Keep this always at the start */
+ DLOG_DEFAULT, /**< Default */
+ DLOG_VERBOSE, /**< Verbose */
+ DLOG_DEBUG, /**< Debug */
+ DLOG_INFO, /**< Info */
+ DLOG_WARN, /**< Warning */
+ DLOG_ERROR, /**< Error */
+ DLOG_FATAL, /**< Fatal */
+ DLOG_SILENT, /**< Silent */
+ DLOG_PRIO_MAX /**< Keep this always at the end. */
+} log_priority;
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_SYSTEM_DLOG
+ * @{
+ */
+/**
+ * @brief Send log with priority and tag.
+ * @details for application
+ * @since_tizen 2.3
+ * @param[in] prio log_priority
+ * @param[in] tag tag
+ * @param[in] fmt format string
+ * @return On success, the function returns the number of bytes written.
+ * On error, a negative errno-style error code
+ * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
+ * @pre none
+ * @post none
+ * @see dlog_vprint
+ * @code
+#include<dlog.h>
+int main(void)
+{
+ int integer = 21;
+ char string[] = "test dlog";
+
+ dlog_print(DLOG_INFO, "USR_TAG", "test dlog");
+ dlog_print(DLOG_INFO, "USR_TAG", "%s, %d", string, integer);
+ return 0;
+}
+ * @endcode
+ */
+int dlog_print(log_priority prio, const char *tag, const char *fmt, ...);
+
+/**
+ * @brief Send log with priority, tag and va_list.
+ * @details for application
+ * @since_tizen 2.3
+ * @param[in] prio log_priority
+ * @param[in] tag tag
+ * @param[in] fmt format string
+ * @param[in] ap va_list
+ * @return On success, the function returns the number of bytes written.
+ * On error, a negative errno-style error code
+ * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
+ * @pre none
+ * @post none
+ * @see dlog_print
+ * @code
+#include<dlog.h>
+void my_debug_print(char *format, ...)
+{
+ va_list ap;
+
+ va_start(ap, format);
+ dlog_vprint(DLOG_INFO, "USR_TAG", format, ap);
+ va_end(ap);
+}
+
+int main(void)
+{
+ my_debug_print("%s", "test dlog");
+ my_debug_print("%s, %d", "test dlog", 21);
+ return 0;
+}
+ * @endcode
+ */
+int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap);
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* _DLOG_H_*/
%files -n libdlog-devel
%{_includedir}/dlog/dlog.h
+%{_includedir}/dlog/dlog-internal.h
%{_libdir}/pkgconfig/dlog.pc
%{_libdir}/libdlog.so