Browse code

core: L_NPRL aliased to L_ALERT-1 to allow printing messages without level name

- new defines LM_NPRL() and NPRL() are using it

Daniel-Constantin Mierla authored on 19/03/2014 15:30:21
Showing 1 changed files
... ...
@@ -86,6 +86,7 @@
86 86
 /*
87 87
  * Log levels
88 88
  */
89
+#define L_NPRL		-6 /* (L_MIN-1) to skip printing level prefix */
89 90
 #define L_MIN		-5
90 91
 #define L_ALERT		-5
91 92
 #define L_BUG		-4
... ...
@@ -321,6 +322,7 @@ void dprint_term_color(char f, char b, str *obuf);
321 321
  */
322 322
 /*@ { */
323 323
 #ifdef __SUNPRO_C
324
+#	define NPRL(...)   LOG(L_NPRL,  __VA_ARGS__)
324 325
 #	define ALERT(...)  LOG(L_ALERT,  __VA_ARGS__)
325 326
 #	define BUG(...)    LOG(L_BUG,   __VA_ARGS__)
326 327
 #	define ERR(...)    LOG(L_ERR,    __VA_ARGS__)
... ...
@@ -340,6 +342,7 @@ void dprint_term_color(char f, char b, str *obuf);
340 340
 #	define DEBUG(...) DBG(__VA_ARGS__)
341 341
 
342 342
 #else /* ! __SUNPRO_C */
343
+#	define NPRL(fmt, args...)   LOG(L_NPRL,  fmt , ## args)
343 344
 #	define ALERT(fmt, args...)  LOG(L_ALERT,  fmt , ## args)
344 345
 #	define BUG(fmt, args...)    LOG(L_BUG,   fmt , ## args)
345 346
 #	define ERR(fmt, args...)    LOG(L_ERR,    fmt , ## args)
... ...
@@ -364,6 +367,7 @@ void dprint_term_color(char f, char b, str *obuf);
364 364
 
365 365
 #define LM_GEN1 LOG
366 366
 #define LM_GEN2 LOG_FC
367
+#define LM_NPRL NPRL
367 368
 #define LM_ALERT ALERT
368 369
 #define LM_CRIT  CRIT
369 370
 #define LM_ERR ERR