13 #include <rpm/rpmutil.h>
40 #define RPMLOG_PRIMASK 0x07
42 #define RPMLOG_PRI(p) ((p) & RPMLOG_PRIMASK)
43 #define RPMLOG_MAKEPRI(fac, pri) ((((unsigned)(fac)) << 3) | (pri))
46 #define _RPMLOG_NOPRI 0x10
48 #define _RPMLOG_MARK RPMLOG_MAKEPRI(RPMLOG_NFACILITIES, 0)
49 typedef struct _rpmcode {
54 RPMCODE rpmprioritynames[] =
63 {
"none", _RPMLOG_NOPRI },
99 #define RPMLOG_NFACILITIES 24
100 RPMLOG_ERRMSG = (((unsigned)(RPMLOG_NFACILITIES+0))<<3)
103 #define RPMLOG_FACMASK 0x03f8
104 #define RPMLOG_FAC(p) (((p) & RPMLOG_FACMASK) >> 3)
108 RPMCODE facilitynames[] =
118 {
"mark", _RPMLOG_MARK },
139 #define RPMLOG_MASK(pri) (1 << ((unsigned)(pri)))
140 #define RPMLOG_UPTO(pri) ((1 << (((unsigned)(pri))+1)) - 1)
148 #define RPMLOG_PID 0x01
149 #define RPMLOG_CONS 0x02
150 #define RPMLOG_ODELAY 0x04
151 #define RPMLOG_NDELAY 0x08
152 #define RPMLOG_NOWAIT 0x10
153 #define RPMLOG_PERROR 0x20
158 #define RPMLOG_DEFAULT 0x01
159 #define RPMLOG_EXIT 0x02
163 typedef struct rpmlogRec_s * rpmlogRec;
213 void rpmlogOpen (
const char * ident,
int option,
int facility);
264 #define rpmSetVerbosity(_lvl) \
265 ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
266 #define rpmIncreaseVerbosity() \
267 ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
268 #define rpmDecreaseVerbosity() \
269 ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
270 #define rpmIsNormal() \
271 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE ))
272 #define rpmIsVerbose() \
273 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO ))
274 #define rpmIsDebug() \
275 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG ))