Browse code

core: LOG_LN() new macro to print log messages overwriting log level name

Daniel-Constantin Mierla authored on 19/03/2014 21:15:12
Showing 1 changed files
... ...
@@ -167,11 +167,13 @@ void dprint_term_color(char f, char b, str *obuf);
167 167
 #		define LOG_(facility, level, prefix, fmt, ...)
168 168
 #		define LOG(level, fmt, ...)
169 169
 #		define LOG_FC(facility, level, fmt, ...)
170
+#		define LOG_LN(level, lname, fmt, ...)
170 171
 #	else
171 172
 #		define LOG__(facility, level, lname, prefix, fmt, args...)
172 173
 #		define LOG_(facility, level, prefix, fmt, args...)
173 174
 #		define LOG(level, fmt, args...)
174 175
 #		define LOG_FC(facility, level, fmt, args...)
176
+#		define LOG_LN(level, lname, fmt, args...)
175 177
 #	endif
176 178
 
177 179
 #else
... ...
@@ -246,6 +248,11 @@ void dprint_term_color(char f, char b, str *obuf);
246 248
 #			define LOG_FC(facility, level, fmt, ...) \
247 249
 	LOG_((facility), (level), LOC_INFO, "%s(): " fmt,\
248 250
 				_FUNC_NAME_, __VA_ARGS__)
251
+
252
+#			define LOG_LN(level, lname, fmt, ...) \
253
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt,\
254
+				_FUNC_NAME_, __VA_ARGS__)
255
+
249 256
 #		else /* LOG_FUNC_NAME */
250 257
 
251 258
 #			define LOG(level, fmt, ...) \
... ...
@@ -254,6 +261,9 @@ void dprint_term_color(char f, char b, str *obuf);
254 261
 #			define LOG_FC(facility, level, fmt, ...) \
255 262
 	LOG_((facility), (level), LOC_INFO, fmt, __VA_ARGS__)
256 263
 
264
+#			define LOG_LN(level, lname, fmt, ...) \
265
+	LOG_(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt, __VA_ARGS__)
266
+
257 267
 #		endif /* LOG_FUNC_NAME */
258 268
 
259 269
 #	else /* ! __SUNPRO_C */
... ...
@@ -316,11 +326,17 @@ void dprint_term_color(char f, char b, str *obuf);
316 326
 #			define LOG_FC(facility, level, fmt, args...) \
317 327
 	LOG_((facility), (level), LOC_INFO, "%s(): " fmt , _FUNC_NAME_, ## args)
318 328
 
329
+#			define LOG_LN(level, lname, fmt, args...) \
330
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt ,\
331
+			_FUNC_NAME_, ## args)
332
+
319 333
 #		else /* LOG_FUNC_NAME */
320 334
 #			define LOG(level, fmt, args...) \
321 335
 	LOG_(DEFAULT_FACILITY, (level), LOC_INFO, fmt , ## args)
322 336
 #			define LOG_FC(facility, level, fmt, args...) \
323 337
 	LOG_((facility), (level), LOC_INFO, fmt , ## args)
338
+#			define LOG_LN(level, lname, fmt, args...) \
339
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt , ## args)
324 340
 
325 341
 #		endif /* LOG_FUNC_NAME */
326 342
 #	endif /* __SUNPRO_C */