OSSP CVS Repository

ossp - Check-in [1719]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1719
Date: 2002-Jan-30 16:42:44 (local)
2002-Jan-30 15:42:44 (UTC)
User:rse
Branch:
Comment: make logX utility macros public
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2.h.in      1.27 -> 1.28     8 inserted, 1 deleted

ossp-pkg/l2/l2.h.in 1.27 -> 1.28

--- l2.h.in      2002/01/02 17:07:38     1.27
+++ l2.h.in      2002/01/30 15:42:44     1.28
@@ -99,10 +99,17 @@
 /* macro describing all levels */
 #define L2_LEVEL_ALL ((1 << (8+9+1))-1)
 
-/* macr describing all levels from highest (PANIC) 
+/* macro describing all levels from highest (PANIC) 
    to and including a particular low level */
 #define L2_LEVEL_UPTO(level) (((level)-1)|(level))
 
+/* macros for easy logging */
+#define log0(ctx,level,msg)             l2_channel_log((ctx)->l2, L2_LEVEL_##level, "%P" msg)
+#define log1(ctx,level,msg,a1)          l2_channel_log((ctx)->l2, L2_LEVEL_##level, "%P" msg, a1)
+#define log2(ctx,level,msg,a1,a2)       l2_channel_log((ctx)->l2, L2_LEVEL_##level, "%P" msg, a1, a2)
+#define log3(ctx,level,msg,a1,a2,a3)    l2_channel_log((ctx)->l2, L2_LEVEL_##level, "%P" msg, a1, a2, a3)
+#define log4(ctx,level,msg,a1,a2,a3,a4) l2_channel_log((ctx)->l2, L2_LEVEL_##level, "%P" msg, a1, a2, a3, a4)
+
 /* list of return values */
 typedef enum {
     L2_OK,         /* everything ok */

CVSTrac 2.0.1