8fe6647a1bc4eef926b415d217f7ca560e1fe9e2
[framework/system/dlog.git] / include / dlog.h
1 /*
2  * DLOG
3  * Copyright (c) 2005-2008, The Android Open Source Project
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
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
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
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.
17  */
18 /**
19  * @file        dlog.h
20  * @version     0.4
21  * @brief       This file is the header file of interface of dlog.
22  */
23 /**
24  * @addtogroup APPLICATION_FRAMEWORK
25  * @{
26  *
27  * @defgroup dlog dlog
28  * @addtogroup dlog
29  * @{
30
31  */
32 #ifndef _DLOG_H_
33 #define _DLOG_H_
34
35 #include<stdarg.h>
36 #include<string.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42 /*
43  * Normally we strip LOGV (VERBOSE messages) from release builds.
44  */
45 #ifndef LOG_NDEBUG
46 #ifdef NDEBUG
47 #define LOG_NDEBUG 1
48 #else
49 #define LOG_NDEBUG 0
50 #endif
51 #endif
52
53 /*
54  * This is the local tag used for the following simplified
55  * logging macros.  You can change this preprocessor definition
56  * before using the other macros to change the tag.
57  */
58 #ifndef LOG_TAG
59 #define LOG_TAG NULL
60 #endif
61
62 #define LOG_ON() _get_logging_on()
63
64 #ifndef __MODULE__
65 #define __MODULE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
66 #endif
67 /*
68  * log priority values, in ascending priority order.
69  */
70 typedef enum {
71         DLOG_UNKNOWN = 0,
72         DLOG_DEFAULT,
73         DLOG_VERBOSE,
74         DLOG_DEBUG,
75         DLOG_INFO,
76         DLOG_WARN,
77         DLOG_ERROR,
78         DLOG_FATAL,
79         DLOG_SILENT,
80 } log_priority;
81
82 typedef enum {
83     LOG_ID_MAIN = 0,
84         LOG_ID_RADIO,
85         LOG_ID_SYSTEM,
86         LOG_ID_APPS,
87         LOG_ID_MAX
88 } log_id_t;
89
90 #define CONDITION(cond)     (__builtin_expect((cond) != 0, 0))
91
92 // ---------------------------------------------------------------------
93 /**
94  * Secure Log Macro.
95  */
96
97 #define _SECURE_LOG 1
98
99 #ifndef SECLOG
100 #if _SECURE_LOG
101 #define SECLOG(...)   (0)
102 #else
103 #define SECLOG(format, arg...) \
104         (LOG_ON() ? (SLOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
105 #endif
106 #endif
107
108 // ---------------------------------------------------------------------
109 /**
110  * Simplified macro to send a verbose log message using the current LOG_TAG.
111  */
112 #ifndef LOGV
113 #if LOG_NDEBUG
114 #define LOGV(...)   (0)
115 #else
116 #define LOGV(format, arg...) \
117         (LOG_ON() ? (LOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
118 #endif
119 #endif
120 /**
121  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
122  */
123 #ifndef LOGV_IF
124 #if LOG_NDEBUG
125 #define LOGV_IF(cond, format, arg...)   (0)
126 #else
127 #define LOGV_IF(cond, format, arg...) \
128         (((CONDITION(cond)) && (LOG_ON())) ? \
129           (LOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
130 #endif
131 #endif
132 /**
133  * Simplified macro to send a debug log message using the current LOG_TAG.
134  */
135 #ifndef LOGD
136 #define LOGD(format, arg...) \
137         (LOG_ON() ? (LOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
138 #endif
139 /**
140  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
141  */
142 #ifndef LOGD_IF
143 #define LOGD_IF(cond, format, arg...) \
144         (((CONDITION(cond)) && (LOG_ON())) ? \
145           (LOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
146 #endif
147
148 /**
149  * Simplified macro to send an info log message using the current LOG_TAG.
150  */
151 #ifndef LOGI
152 #define LOGI(format, arg...) \
153         (LOG_ON() ? (LOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
154 #endif
155 /**
156  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
157  */
158 #ifndef LOGI_IF
159 #define LOGI_IF(cond, format, arg...) \
160         (((CONDITION(cond)) && (LOG_ON())) ? \
161           (LOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
162 #endif
163
164 /**
165  * Simplified macro to send a warning log message using the current LOG_TAG.
166  */
167 #ifndef LOGW
168 #define LOGW(format, arg...) \
169         (LOG_ON() ? (LOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
170 #endif
171 /**
172  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
173  */
174 #ifndef LOGW_IF
175 #define LOGW_IF(cond, format, arg...) \
176         (((CONDITION(cond)) && (LOG_ON())) ? \
177           (LOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
178 #endif
179
180 /**
181  * Simplified macro to send an error log message using the current LOG_TAG.
182  */
183 #ifndef LOGE
184 #define LOGE(format, arg...) \
185         (LOG_ON() ? (LOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
186 #endif
187 /**
188  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
189  */
190 #ifndef LOGE_IF
191 #define LOGE_IF(cond, format, arg...) \
192         (((CONDITION(cond)) && (LOG_ON())) ? \
193           (LOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
194 #endif
195 /**
196  * Simplified macro to send an error log message using the current LOG_TAG.
197  */
198 #ifndef LOGF
199 #define LOGF(format, arg...) \
200         (LOG_ON() ? (LOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
201 #endif
202 /**
203  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
204  */
205 #ifndef LOGF_IF
206 #define LOGF_IF(cond, format, arg...) \
207         (((CONDITION(cond)) && (LOG_ON())) ? \
208           (LOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
209 #endif
210
211 // ---------------------------------------------------------------------
212 /**
213  * Simplified radio macro to send a verbose log message using the current LOG_TAG.
214  */
215 #ifndef RLOGV
216 #if LOG_NDEBUG
217 #define RLOGV(...)   (0)
218 #else
219 #define RLOGV(format, arg...) \
220         (LOG_ON() ? (RLOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
221 #endif
222 #endif
223 /**
224  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
225  */
226 #ifndef RLOGV_IF
227 #if LOG_NDEBUG
228 #define RLOGV_IF(cond, format, arg...)   (0)
229 #else
230 #define RLOGV_IF(cond, format, arg...) \
231         (((CONDITION(cond)) && (LOG_ON())) ? \
232           (RLOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
233 #endif
234 #endif
235
236 /**
237  * Simplified radio macro to send a debug log message using the current LOG_TAG.
238  */
239 #ifndef RLOGD
240 #define RLOGD(format, arg...) \
241         (LOG_ON() ? (RLOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
242 #endif
243 /**
244  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
245  */
246 #ifndef RLOGD_IF
247 #define RLOGD_IF(cond, format, arg...) \
248         (((CONDITION(cond)) && (LOG_ON())) ? \
249           (RLOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
250 #endif
251
252 /**
253  * Simplified radio macro to send an info log message using the current LOG_TAG.
254  */
255 #ifndef RLOGI
256 #define RLOGI(format, arg...) \
257         (LOG_ON() ? (RLOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
258 #endif
259 /**
260  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
261  */
262 #ifndef RLOGI_IF
263 #define RLOGI_IF(cond, format, arg...) \
264         (((CONDITION(cond)) && (LOG_ON())) ? \
265           (RLOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
266 #endif
267
268 /**
269  * Simplified radio macro to send a warning log message using the current LOG_TAG.
270  */
271 #ifndef RLOGW
272 #define RLOGW(format, arg...) \
273         (LOG_ON() ? (RLOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
274 #endif
275 /**
276  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
277  */
278 #ifndef RLOGW_IF
279 #define RLOGW_IF(cond, format, arg...) \
280         (((CONDITION(cond)) && (LOG_ON())) ? \
281           (RLOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
282 #endif
283
284 /**
285  * Simplified radio macro to send an error log message using the current LOG_TAG.
286  */
287 #ifndef RLOGE
288 #define RLOGE(format, arg...) \
289         (LOG_ON() ? (RLOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
290 #endif
291 /**
292  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
293  */
294 #ifndef RLOGE_IF
295 #define RLOGE_IF(cond, format, arg...) \
296         (((CONDITION(cond)) && (LOG_ON())) ? \
297           (RLOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
298 #endif
299 /**
300  * Simplified radio macro to send an error log message using the current LOG_TAG.
301  */
302 #ifndef RLOGF
303 #define RLOGF(format, arg...) \
304         (LOG_ON() ? (RLOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
305 #endif
306 /**
307  * Simplified radio macro to send a conditional verbose log message using the current LOG_TAG.
308  */
309 #ifndef RLOGF_IF
310 #define RLOGF_IF(cond, format, arg...) \
311         (((CONDITION(cond)) && (LOG_ON())) ? \
312           (RLOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
313 #endif
314
315
316 // ---------------------------------------------------------------------
317 /**
318  * Simplified system macro to send a verbose log message using the current LOG_TAG.
319  */
320 #ifndef SLOGV
321 #if LOG_NDEBUG
322 #define SLOGV(...)   (0)
323 #else
324 #define SLOGV(format, arg...) \
325         (LOG_ON() ? (SLOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
326 #endif
327 #endif
328 /**
329  * Simplified macro to send a conditional verbose log message using the current LOG_TAG.
330  */
331 #ifndef SLOGV_IF
332 #if LOG_NDEBUG
333 #define SLOGV_IF(cond, format, arg...)   (0)
334 #else
335 #define SLOGV_IF(cond, format, arg...) \
336         (((CONDITION(cond)) && (LOG_ON())) ? \
337           (SLOG(LOG_VERBOSE, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
338 #endif
339 #endif
340
341 /**
342  * Simplified system macro to send a debug log message using the current LOG_TAG.
343  */
344 #ifndef SLOGD
345 #define SLOGD(format, arg...) \
346         (LOG_ON() ? (SLOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
347 #endif
348 /**
349  * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
350  */
351 #ifndef SLOGD_IF
352 #define SLOGD_IF(cond, format, arg...) \
353         (((CONDITION(cond)) && (LOG_ON())) ? \
354           (SLOG(LOG_DEBUG, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
355 #endif
356
357 /**
358  * Simplified system macro to send an info log message using the current LOG_TAG.
359  */
360 #ifndef SLOGI
361 #define SLOGI(format, arg...) \
362         (LOG_ON() ? (SLOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
363 #endif
364 /**
365  * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
366  */
367 #ifndef SLOGI_IF
368 #define SLOGI_IF(cond, format, arg...) \
369         (((CONDITION(cond)) && (LOG_ON())) ? \
370           (SLOG(LOG_INFO, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
371 #endif
372
373 /**
374  * Simplified system macro to send a warning log message using the current LOG_TAG.
375  */
376 #ifndef SLOGW
377 #define SLOGW(format, arg...) \
378         (LOG_ON() ? (SLOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
379 #endif
380 /**
381  * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
382  */
383 #ifndef SLOGW_IF
384 #define SLOGW_IF(cond, format, arg...) \
385         (((CONDITION(cond)) && (LOG_ON())) ? \
386           (SLOG(LOG_WARN, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
387 #endif
388
389 /**
390  * Simplified system macro to send an error log message using the current LOG_TAG.
391  */
392 #ifndef SLOGE
393 #define SLOGE(format, arg...) \
394         (LOG_ON() ? (SLOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
395 #endif
396 /**
397  * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
398  */
399 #ifndef SLOGE_IF
400 #define SLOGE_IF(cond, format, arg...) \
401         (((CONDITION(cond)) && (LOG_ON())) ? \
402           (SLOG(LOG_ERROR, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
403 #endif
404 /**
405  * Simplified system macro to send an error log message using the current LOG_TAG.
406  */
407 #ifndef SLOGF
408 #define SLOGF(format, arg...) \
409         (LOG_ON() ? (SLOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
410 #endif
411 /**
412  * Simplified system macro to send a conditional verbose log message using the current LOG_TAG.
413  */
414 #ifndef SLOGF_IF
415 #define SLOGF_IF(cond, format, arg...) \
416         (((CONDITION(cond)) && (LOG_ON())) ? \
417           (SLOG(LOG_FATAL, LOG_TAG, "%s: %s(%d) > " format, __MODULE__, __func__, __LINE__, ##arg)) : (0))
418 #endif
419
420 // ---------------------------------------------------------------------
421
422 /**
423  * Simplified macro to send a verbose log message using the current LOG_TAG.
424  */
425 #ifndef ALOGV
426 #if LOG_NDEBUG
427 #define ALOGV(...)   (0)
428 #else
429 #define ALOGV(...) (ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
430 #endif
431 #endif
432 /**
433  * Simplified macro to send a debug log message using the current LOG_TAG.
434  */
435 #ifndef ALOGD
436 #define ALOGD(...) (ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
437 #endif
438 /**
439  * Simplified macro to send an info log message using the current LOG_TAG.
440  */
441 #ifndef ALOGI
442 #define ALOGI(...) (ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
443 #endif
444 /**
445  * Simplified macro to send a warning log message using the current LOG_TAG.
446  */
447 #ifndef ALOGW
448 #define ALOGW(...) (ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
449 #endif
450 /**
451  * Simplified macro to send an error log message using the current LOG_TAG.
452  */
453 #ifndef ALOGE
454 #define ALOGE(...) (ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
455 #endif
456
457
458 // ---------------------------------------------------------------------
459 /**
460  * Basic log message macro that allows you to specify a priority and a tag
461  *
462  * Example:
463  *  LOG(DLOG_WARN, NULL, "Failed with error %d", errno);
464  *
465  * The second argument may be NULL or "" to indicate the "global" tag.
466  * 
467  * Future work : we want to put filename and line number automatically only when debug build mode 
468  */
469 #ifndef LOG
470 #define LOG(priority, tag, ...) \
471         print_log(D##priority, tag, __VA_ARGS__)
472 #endif
473
474 /**
475  * Log macro that allows you to pass in a varargs ("args" is a va_list).
476  */
477 #ifndef LOG_VA
478 #define LOG_VA(priority, tag, fmt, args) \
479     vprint_log(D##priority, tag, fmt, args)
480 #endif
481
482 #ifndef ALOG
483 #define ALOG(priority, tag, ...) \
484         print_apps_log(D##priority, tag, __VA_ARGS__)
485 #endif
486 /**
487  * Log macro that allows you to pass in a varargs ("args" is a va_list).
488  */
489 #ifndef ALOG_VA
490 #define ALOG_VA(priority, tag, fmt, args) \
491     vprint_apps_log(D##priority, tag, fmt, args)
492 #endif
493
494 /**
495  * Basic radio log macro that allows you to specify a priority and a tag.
496  */
497 #ifndef RLOG
498 #define RLOG(priority, tag, ...) \
499         print_radio_log(D##priority, tag, __VA_ARGS__)
500 #endif
501 /**
502  * Radio log macro that allows you to pass in a varargs ("args" is a va_list).
503  */
504 #ifndef RLOG_VA
505 #define RLOG_VA(priority, tag, fmt, args) \
506     vprint_radio_log(D##priority, tag, fmt, args)
507 #endif
508
509 /**
510  * Basic system log macro that allows you to specify a priority and a tag.
511  */
512 #ifndef SLOG
513 #define SLOG(priority, tag, ...) \
514     print_system_log(D##priority, tag, __VA_ARGS__)
515 #endif
516
517 /**
518  * System log macro that allows you to pass in a varargs ("args" is a va_list).
519  */
520 #ifndef SLOG_VA
521 #define SLOG_VA(priority, tag, fmt, args) \
522     vprint_system_log(D##priority, tag, fmt, args)
523 #endif
524
525
526 /*
527  * ===========================================================================
528  *
529  * The stuff in the rest of this file should not be used directly.
530  */
531
532 #define print_apps_log(prio, tag, fmt...) \
533         __dlog_print(LOG_ID_APPS, prio, tag, fmt)
534
535 #define vprint_apps_log(prio, tag, fmt...) \
536         __dlog_vprint(LOG_ID_APPS, prio, tag, fmt)
537
538 #define print_log(prio, tag, fmt...) \
539         __dlog_print(LOG_ID_MAIN, prio, tag, fmt)
540
541 #define vprint_log(prio, tag, fmt...) \
542         __dlog_vprint(LOG_ID_MAIN, prio, tag, fmt)
543
544 #define print_radio_log(prio, tag, fmt...)\
545         __dlog_print(LOG_ID_RADIO, prio, tag, fmt)
546
547 #define vprint_radio_log(prio, tag, fmt...) \
548         __dlog_vprint(LOG_ID_RADIO, prio, tag, fmt)
549
550 #define print_system_log(prio, tag, fmt...)\
551         __dlog_print(LOG_ID_SYSTEM, prio, tag, fmt)
552
553 #define vprint_system_log(prio, tag, fmt...) \
554         __dlog_vprint(LOG_ID_SYSTEM, prio, tag, fmt)
555
556 /**
557  * @brief               send log. must specify log_id ,priority, tag and format string.
558  * @pre         none
559  * @post                none
560  * @see         __dlog_print
561  * @remarks     you must not use this API directly. use macros instead.
562  * @param[in]   log_id  log device id
563  * @param[in]   prio    priority
564  * @param[in]   tag     tag
565  * @param[in]   fmt     format string 
566  * @return                      Operation result
567  * @retval              0>=     Success
568  * @retval              -1      Error
569  * @code
570 // you have to use LOG(), SLOG(), RLOG() family not to use __dlog_print() directly
571 // so below example is just for passing Documentation Verification !!!
572 #define LOG_TAG USR_TAG
573 #include<dlog.h>
574  __dlog_print(LOG_ID_MAIN, DLOG_INFO, USR_TAG, "you must not use this API directly");
575  * @endcode
576  */
577 int __dlog_print(log_id_t log_id, int prio, const char *tag, const char *fmt, ...);
578
579 /**
580  * @brief               send log with va_list. must specify log_id ,priority, tag and format string.
581  * @pre         none
582  * @post                none
583  * @see         __dlog_print
584  * @remarks     you must not use this API directly. use macros instead.
585  * @param[in]   log_id  log device id
586  * @param[in]   prio    priority
587  * @param[in]   tag     tag
588  * @param[in]   fmt     format string
589  * @param[in]   ap      va_list
590  * @return                      Operation result
591  * @retval              0>=     Success
592  * @retval              -1      Error
593  * @code
594  // you have to use LOG_VA(), SLOG_VA(), RLOG_VA() family not to use __dlog_print() directly
595  // so below example is just for passing Documentation Verification !!!
596 #define LOG_TAG USR_TAG
597 #include<dlog.h>
598   __dlog_vprint(LOG_ID_MAIN, DLOG_INFO, USR_TAG, "you must not use this API directly", ap);
599  * @endcode
600   */
601 int __dlog_vprint(log_id_t log_id, int prio, const char *tag, const char *fmt, va_list ap);
602 int _get_logging_on(void);
603
604 #ifdef __cplusplus
605 }
606 #endif /* __cplusplus */
607
608
609 /** @} */
610 /** @} */
611
612 #endif /* _DLOG_H_*/
613