dlog
Logging framework
 All Files Functions Typedefs Enumerations Enumerator Groups Pages
dlog.h
Go to the documentation of this file.
1 /* MIT License
2  *
3  * Copyright (c) 2012-2020 Samsung Electronics Co., Ltd
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy
6  * of this software and associated documentation files (the "Software"), to deal
7  * in the Software without restriction, including without limitation the rights
8  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9  * copies of the Software, and to permit persons to whom the Software is furnished
10  * to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21  * THE SOFTWARE. */
22 
23 
31 #ifndef _DLOG_H_
32 #define _DLOG_H_
33 
34 #include <stdarg.h>
35 #include <string.h>
36 #include <tizen_error.h>
37 /*
38  * This is for checking dlog_print format string.
39  */
40 #pragma GCC diagnostic warning "-Wformat"
41 #include "dlog-internal.h"
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif /* __cplusplus */
46 
47 
48 /*
49  * This is the local tag used for the following simplified
50  * logging macros. You can change this preprocessor definition
51  * before using the other macros to change the tag.
52  */
53 #ifndef LOG_TAG
54 #define LOG_TAG NULL
55 #endif
56 
57 
69 typedef enum {
70  DLOG_ERROR_NONE = TIZEN_ERROR_NONE,
71  DLOG_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,
72  DLOG_ERROR_NOT_PERMITTED = TIZEN_ERROR_NOT_PERMITTED
73 } dlog_error_e;
74 
75 
91 typedef enum {
102 } log_priority;
103 
104 
144 int dlog_print(log_priority prio, const char *tag, const char *fmt, ...) __attribute__((format(printf, 3, 4)));
145 
146 
182 int dlog_vprint(log_priority prio, const char *tag, const char *fmt, va_list ap);
183 
184 
190 #ifdef __cplusplus
191 }
192 #endif /* __cplusplus */
193 #endif /* _DLOG_H_*/