3 * Copyright (c) 2005-2008, The Android Open Source Project
4 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
22 * @brief This file is the header file of interface of dlog.
29 #include <tizen_error.h>
30 #include "dlog-internal.h"
34 #endif /* __cplusplus */
37 * This is the local tag used for the following simplified
38 * logging macros. You can change this preprocessor definition
39 * before using the other macros to change the tag.
46 * @addtogroup CAPI_SYSTEM_DLOG
51 * @brief Enumeration for Dlog Error.
52 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
55 DLOG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
56 DLOG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
57 DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */
64 * @addtogroup CAPI_SYSTEM_DLOG
69 * @brief log priority values, in ascending priority order.
70 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
73 DLOG_UNKNOWN = 0, /**< Keep this always at the start */
74 DLOG_DEFAULT, /**< Default */
75 DLOG_VERBOSE, /**< Verbose */
76 DLOG_DEBUG, /**< Debug */
77 DLOG_INFO, /**< Info */
78 DLOG_WARN, /**< Warning */
79 DLOG_ERROR, /**< Error */
80 DLOG_FATAL, /**< Fatal */
81 DLOG_SILENT, /**< Silent */
82 DLOG_PRIO_MAX /**< Keep this always at the end. */
89 * @addtogroup CAPI_SYSTEM_DLOG
93 * @brief Send log with priority and tag.
94 * @details for application
95 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
96 * @param[in] prio log_priority
98 * @param[in] fmt format string
99 * @return On success, the function returns the number of bytes written.
100 * On error, a negative errno-style error code
101 * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
102 * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
111 char string[] = "test dlog";
113 dlog_print(DLOG_INFO, "USR_TAG", "test dlog");
114 dlog_print(DLOG_INFO, "USR_TAG", "%s, %d", string, integer);
119 int dlog_print(log_priority prio, const char *tag, const char *fmt, ...);
122 * @brief Send log with priority, tag and va_list.
123 * @details for application
124 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @elseif TV 3.0 @endif
125 * @param[in] prio log_priority
127 * @param[in] fmt format string
128 * @param[in] ap va_list
129 * @return On success, the function returns the number of bytes written.
130 * On error, a negative errno-style error code
131 * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
132 * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
138 void my_debug_print(char *format, ...)
142 va_start(ap, format);
143 dlog_vprint(DLOG_INFO, "USR_TAG", format, ap);
149 my_debug_print("%s", "test dlog");
150 my_debug_print("%s, %d", "test dlog", 21);
155 int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap);
162 #endif /* __cplusplus */