2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SYSTEM_DLOG_DOC_H__
18 #define __TIZEN_SYSTEM_DLOG_DOC_H__
21 * @defgroup CAPI_SYSTEM_DLOG dlog
22 * @brief The Dlog API provides functions for sending log output.
23 * @ingroup CAPI_SYSTEM_FRAMEWORK
24 * @section CAPI_SYSTEM_DLOG_HEADER Required Header
27 * @section CAPI_SYSTEM_DLOG_OVERVIEW Overview
29 Sending log message to circular buffer. dlog APIs include Priority and Tag. By using priority and Tag, we can easily filtered messages what we want to see.
30 <h2 class="pg">priority</h2>
31 priority level indicates the urgency of log message
40 <td>Debug messasge. - Log message which developer want to check.</td>
44 <td>Information message - Normal operational messages. above of this priority will always be logged.</td>
48 <td>Warning messages - Not an error, but indication that an error will occur if action is not taken.</td>
52 <td>Error message - Indicate error.</td>
56 <h2 class="pg">Macro example for useful usage</h2>
57 The dlog APIs can be used by defining own macros. The macros can be defined like below examples.
58 Thus, developers can use appropriate method as a matter of convenience.
62 #define LOG_TAG "APP_TAG"
64 #define LOGI(fmt, arg...) \
66 dlog_print(DLOG_INFO, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); \
68 #define LOGW(fmt, arg...) \
70 dlog_print(DLOG_WARN, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); \
72 #define LOGE(fmt, arg...) \
74 dlog_print(DLOG_ERROR, LOG_TAG, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##arg); \
78 <h1 class="pg">dlogutil</h1>
79 <h2 class="pg">Introduction</h2>
80 You can use dlogutil command to view and follow the contents of the log buffers. The general usage is :
82 dlogutil [<option>] ... [<filter-spec>] ...
85 <h2 class="pg">Filtering log output</h2>
86 Every log message has a <I>tag</I> and a <I>priority</I> associated with it.
87 Filter expression follows this format <B><I>tag:priority</I></B> where <I>tag</I> indicates the tag of interest and <I>priority</I> indicates the minimum level of priority to report for that tag. You can add any number of tag:priority specifications in a single filter expression.
88 The tag of a log message is a short indicating the system component from which the message originates
89 The <I>priority</I> is one of the following character values, orderd from lowest to highest priority:<br>
95 for example, if you want to see MY_APP tag and above of debug priority,
99 if you want to see all log message above of info priority.
104 <h2 class="pg">List of logutil command options</h2>
112 <td>-b \<buffer\> </td>
113 <td>Alternate log buffer. The main buffer is used by default buffer. </td>
117 <td>Clears the entire log and exits</td>
121 <td>Dumps the log and exits.</td>
124 <td>-f \<filename\></td>
125 <td>Writes log to filename. The default is stdout</td>
129 <td>Print the size of the specified log buffer and exits.</td>
132 <td>-n \<count\></td>
133 <td>Sets the maximum number of rotated logs to count. The default value is 4. Requires the -r option</td>
136 <td>-r \<Kbytes\></td>
137 <td>Rotates the log file every Kbytes of output. The default value is 16. Requires the -f option.</td>
141 <td>Sets the default filter spec to silent.</td>
144 <td>-v \<format\></td>
145 <td>Sets the output format for log messages. The default is brief format. </td>
152 #endif /* __TIZEN_SYSTEM_DLOG_DOC_H__ */