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 246
 #			define LOG_FC(facility, level, fmt, ...) \
247 247
 	LOG_((facility), (level), LOC_INFO, "%s(): " fmt,\
248 248
 				_FUNC_NAME_, __VA_ARGS__)
249
+
250
+#			define LOG_LN(level, lname, fmt, ...) \
251
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt,\
252
+				_FUNC_NAME_, __VA_ARGS__)
253
+
249 254
 #		else /* LOG_FUNC_NAME */
250 255
 
251 256
 #			define LOG(level, fmt, ...) \
... ...
@@ -254,6 +261,9 @@ void dprint_term_color(char f, char b, str *obuf);
254 254
 #			define LOG_FC(facility, level, fmt, ...) \
255 255
 	LOG_((facility), (level), LOC_INFO, fmt, __VA_ARGS__)
256 256
 
257
+#			define LOG_LN(level, lname, fmt, ...) \
258
+	LOG_(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt, __VA_ARGS__)
259
+
257 260
 #		endif /* LOG_FUNC_NAME */
258 261
 
259 262
 #	else /* ! __SUNPRO_C */
... ...
@@ -316,11 +326,17 @@ void dprint_term_color(char f, char b, str *obuf);
316 316
 #			define LOG_FC(facility, level, fmt, args...) \
317 317
 	LOG_((facility), (level), LOC_INFO, "%s(): " fmt , _FUNC_NAME_, ## args)
318 318
 
319
+#			define LOG_LN(level, lname, fmt, args...) \
320
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, "%s(): " fmt ,\
321
+			_FUNC_NAME_, ## args)
322
+
319 323
 #		else /* LOG_FUNC_NAME */
320 324
 #			define LOG(level, fmt, args...) \
321 325
 	LOG_(DEFAULT_FACILITY, (level), LOC_INFO, fmt , ## args)
322 326
 #			define LOG_FC(facility, level, fmt, args...) \
323 327
 	LOG_((facility), (level), LOC_INFO, fmt , ## args)
328
+#			define LOG_LN(level, lname, fmt, args...) \
329
+	LOG__(DEFAULT_FACILITY, (level), (lname), LOC_INFO, fmt , ## args)
324 330
 
325 331
 #		endif /* LOG_FUNC_NAME */
326 332
 #	endif /* __SUNPRO_C */