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))
72 #define RPMLOG_NFACILITIES 24
76 #define RPMLOG_FACMASK 0x03f8
77 #define RPMLOG_FAC(p) (((p) & RPMLOG_FACMASK) >> 3)
83 #define RPMLOG_MASK(pri) (1 << ((unsigned)(pri)))
84 #define RPMLOG_UPTO(pri) ((1 << (((unsigned)(pri))+1)) - 1)
92 #define RPMLOG_PID 0x01
93 #define RPMLOG_CONS 0x02
94 #define RPMLOG_ODELAY 0x04
95 #define RPMLOG_NDELAY 0x08
96 #define RPMLOG_NOWAIT 0x10
97 #define RPMLOG_PERROR 0x20
102 #define RPMLOG_DEFAULT 0x01
103 #define RPMLOG_EXIT 0x02
157 void rpmlogOpen (
const char * ident,
int option,
int facility);
208 #define rpmSetVerbosity(_lvl) \
209 ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
210 #define rpmIncreaseVerbosity() \
211 ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
212 #define rpmDecreaseVerbosity() \
213 ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
214 #define rpmIsNormal() \
215 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE ))
216 #define rpmIsVerbose() \
217 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO ))
218 #define rpmIsDebug() \
219 (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG ))
int rpmlogGetNrecs(void)
Return number of rpmError() ressages.
rpmlogFac_e
facility codes
int rpmlogSetMask(int mask)
Set the log mask level.
FILE * rpmlogSetFile(FILE *fp)
Set rpmlog file handle.
void rpmlogOpen(const char *ident, int option, int facility)
Open connection to system logger.
const char * rpmlogRecMessage(rpmlogRec rec)
Retrieve log message string from rpmlog record.
const char * rpmlogLevelPrefix(rpmlogLvl pri)
Return translated prefix string (if any) given log level.
void rpmlogPrint(FILE *f)
Print all rpmError() messages.
enum rpmlogLvl_e rpmlogLvl
RPM Log levels.
int(* rpmlogCallback)(rpmlogRec rec, rpmlogCallbackData data)
void rpmlog(int code, const char *fmt,...) RPM_GNUC_PRINTF(2
Generate a log message using FMT string and option arguments.
void const char * rpmlogMessage(void)
Return text of last rpmError() message.
rpmlogCallback rpmlogSetCallback(rpmlogCallback cb, rpmlogCallbackData data)
Set rpmlog callback function.
void rpmlogClose(void)
Close desriptor used to write to system logger.
struct rpmlogRec_s * rpmlogRec
rpmlogLvl rpmlogRecPriority(rpmlogRec rec)
Retrieve log priority from rpmlog record.
enum rpmlogFac_e rpmlogFac
facility codes
rpmlogLvl_e
RPM Log levels.
int rpmlogCode(void)
Return error code from last rpmError() message.
#define RPMLOG_NFACILITIES
void * rpmlogCallbackData
#define RPM_GNUC_PRINTF(format_idx, arg_idx)