-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathKconfig
234 lines (195 loc) · 6.8 KB
/
Kconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
config LOG_CFG_ENABLE
bool "Enable Log Output"
default y
help
Enable this option to configure the log module.
if LOG_CFG_ENABLE
config LOG_CFG_ENABLE_TIMESTAMP
bool "Format: Timestamp"
default y
help
Enable this option to add a timestamp to the log output.
e.g. "[INFO]:[0.123s]:Hello World"
config LOG_CFG_ENABLE_COLOR
bool "Format: Color"
default y
help
Enable this option to add color to the log output.
e.g. "\033[1;31m[ERROR]:Hello World\033[0m"
config LOG_CFG_ENABLE_FUNC_LINE
bool "Format: Function and Line Number"
default n
help
Enable this option to add the function and line number to the log output.
e.g. "[INFO]:[main:123]:Hello World"
config LOG_CFG_ENABLE_MODULE_NAME
bool "Format: Module Name"
default y
help
Enable this option to add the module name to the log output.
e.g. "[INFO]:[main]:Hello World"
You should define LOG_MODULE in your source file before including log.h.
choice
prompt "Log Level (Global)"
default LOG_CFG_LEVEL_USE_DEBUG
config LOG_CFG_LEVEL_USE_TRACE
bool "Trace"
config LOG_CFG_LEVEL_USE_DEBUG
bool "Debug"
config LOG_CFG_LEVEL_USE_INFO
bool "Info"
config LOG_CFG_LEVEL_USE_PASS
bool "Pass"
config LOG_CFG_LEVEL_USE_WARNING
bool "Warning"
config LOG_CFG_LEVEL_USE_ERROR
bool "Error"
config LOG_CFG_LEVEL_USE_FATAL
bool "Fatal"
config LOG_CFG_LEVEL_USE_ASSERT
bool "Assert"
endchoice
menu "Log Colors Config"
config LOG_CFG_R_COLOR
string "Color: Trace"
default "T_BLUE"
config LOG_CFG_D_COLOR
string "Color: Debug"
default "T_CYAN"
config LOG_CFG_I_COLOR
string "Color: Info"
default "T_GREEN"
config LOG_CFG_P_COLOR
string "Color: Pass"
default "T_LGREEN"
config LOG_CFG_W_COLOR
string "Color: Warning"
default "T_YELLOW"
config LOG_CFG_E_COLOR
string "Color: Error"
default "T_RED"
config LOG_CFG_F_COLOR
string "Color: Fatal"
default "T_MAGENTA"
config LOG_CFG_A_COLOR
string "Color: Assert"
default "T_RED"
config LOG_CFG_T_COLOR
string "Color: Timeit"
default "T_YELLOW"
endmenu
menu "Log String Config"
config LOG_CFG_R_STR
string "String: Trace"
default "\"TRACE\""
config LOG_CFG_D_STR
string "String: Debug"
default "\"DEBUG\""
config LOG_CFG_I_STR
string "String: Info"
default "\"INFO\""
config LOG_CFG_P_STR
string "String: Pass"
default "\"PASS\""
config LOG_CFG_W_STR
string "String: Warning"
default "\"WARN\""
config LOG_CFG_E_STR
string "String: Error"
default "\"ERROR\""
config LOG_CFG_F_STR
string "String: Fatal"
default "\"FATAL\""
config LOG_CFG_A_STR
string "String: Assert"
default "\"ASSERT\""
config LOG_CFG_T_STR
string "String: Timeit"
default "\"TIMEIT\""
endmenu
menu "Advanced Configuration"
config LOG_CFG_ENABLE_ALIAS
bool "Enable Alias for Log Functions"
default n
help
Enable this option to add an alias for the log functions.
e.g. LOG_E("Error") is the same as LOG_ERROR("Error").
config LOG_CFG_ASSERT_FAILED_BLOCK
bool "Block on Assert Failure"
default n
help
Enable this option to enter an infinite loop on assert failure.
config LOG_CFG_PRINTF
string "Log Printf Function"
default "printf"
help
The function to use for log output.
config LOG_CFG_CUSTOM_INCLUDE_ENABLE
bool "Custom Include"
default n
help
Enable this option to include a custom header file.
e.g. to define a custom log function.
config LOG_CFG_CUSTOM_INCLUDE_FILE
string "Include Header File"
depends on LOG_CFG_CUSTOM_INCLUDE_ENABLE
default "\"stdio.h\""
help
The custom header file to include.
config LOG_CFG_TIMESTAMP_FMT
string "Log Timestamp Format"
default "\"%.3fs\""
help
The format string to use for the timestamp (same as printf).
config LOG_CFG_TIMESTAMP_FUNC
string "Log Timestamp Format Function"
default "((float)((uint64_t)m_time_ms()) / 1000)"
help
The function to use for acquiring the timestamp (offers parmeters for the timestamp format).
config LOG_CFG_PREFIX
string "Log Prefix"
default "\"\""
help
The prefix to use for the log output.
e.g. "\r" to move the cursor to the beginning of the line.
config LOG_CFG_SUFFIX
string "Log Suffix"
default "\"\""
help
The suffix to use for the log output.
e.g. "\033[K" to clear the line and move the cursor to the beginning of the next line.
config LOG_CFG_NEWLINE
string "Log Newline"
default "\"\\r\\n\""
help
The newline to use for the log output.
e.g. "\r\n" to move the cursor to the beginning of the next line.
config LOG_CFG_INFO_PREFIX
string "Log Info Prefix"
default "\"[\""
help
The prefix to use for the log info (e.g. timestamp, level, etc.).
config LOG_CFG_INFO_SUFFIX
string "Log Info Suffix"
default "\"]\""
help
The suffix to use for the log info (e.g. timestamp, level, etc.).
config LOG_CFG_INFO_SEPERATOR
string "Log Info Seperator"
default "\" \""
help
The seperator insert to the log info parts.
config LOG_CFG_MSG_SEPERATOR
string "Log Message Seperator"
default "\" \""
help
The seperator between the log info and the log message.
config LOG_CFG_ENABLE_HOOK
bool "Enable Log Hook"
default n
help
Enable this option to add a hook for the log output.
e.g. to send the log output to a file.
To use this, you should define a function: void log_hook(const char *fmt, ...)
endmenu
endif