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.
27 #include <tizen_error.h>
31 #include "dlog-internal.h"
35 #endif /* __cplusplus */
38 * This is the local tag used for the following simplified
39 * logging macros. You can change this preprocessor definition
40 * before using the other macros to change the tag.
47 * @addtogroup CAPI_SYSTEM_DLOG
52 * @brief Enumeration for Dlog Error.
53 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
56 DLOG_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
57 DLOG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
58 DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED /**< Operation not permitted */
65 * @addtogroup CAPI_SYSTEM_DLOG
70 * @brief log priority values, in ascending priority order.
71 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
74 DLOG_UNKNOWN = 0, /**< Keep this always at the start */
75 DLOG_DEFAULT, /**< Default */
76 DLOG_VERBOSE, /**< Verbose */
77 DLOG_DEBUG, /**< Debug */
78 DLOG_INFO, /**< Info */
79 DLOG_WARN, /**< Warning */
80 DLOG_ERROR, /**< Error */
81 DLOG_FATAL, /**< Fatal */
82 DLOG_SILENT, /**< Silent */
83 DLOG_PRIO_MAX /**< Keep this always at the end. */
90 * @addtogroup CAPI_SYSTEM_DLOG
94 * @brief Send log with priority and tag.
95 * @details for application
96 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
97 * @param[in] prio log_priority
99 * @param[in] fmt format string
100 * @return On success, the function returns the number of bytes written.
101 * On error, a negative errno-style error code
102 * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
103 * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
112 char string[] = "test dlog";
114 dlog_print(DLOG_INFO, "USR_TAG", "test dlog");
115 dlog_print(DLOG_INFO, "USR_TAG", "%s, %d", string, integer);
120 int dlog_print(log_priority prio, const char *tag, const char *fmt, ...);
123 * @brief Send log with priority, tag and va_list.
124 * @details for application
125 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
126 * @param[in] prio log_priority
128 * @param[in] fmt format string
129 * @param[in] ap va_list
130 * @return On success, the function returns the number of bytes written.
131 * On error, a negative errno-style error code
132 * @retval #DLOG_ERROR_INVALID_PARAMETER Invalid parameter
133 * @retval #DLOG_ERROR_NOT_PERMITTED Operation not permitted
139 void my_debug_print(char *format, ...)
143 va_start(ap, format);
144 dlog_vprint(DLOG_INFO, "USR_TAG", format, ap);
150 my_debug_print("%s", "test dlog");
151 my_debug_print("%s, %d", "test dlog", 21);
156 int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap);
163 #endif /* __cplusplus */