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 73 RPMLOG_ERRMSG = (((unsigned)(RPMLOG_NFACILITIES+0))<<3) 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 107 typedef struct rpmlogRec_s * rpmlogRec; 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 ))
const char * rpmlogLevelPrefix(rpmlogLvl pri)
Return translated prefix string (if any) given log level.
FILE * rpmlogSetFile(FILE *fp)
Set rpmlog file handle.
void * rpmlogCallbackData
enum rpmlogFac_e rpmlogFac
facility codes
struct rpmlogRec_s * rpmlogRec
void rpmlogClose(void)
Close desriptor used to write to system logger.
void const char * rpmlogMessage(void)
Return text of last rpmError() message.
int(* rpmlogCallback)(rpmlogRec rec, rpmlogCallbackData data)
int rpmlogSetMask(int mask)
Set the log mask level.
rpmlogLvl rpmlogRecPriority(rpmlogRec rec)
Retrieve log priority from rpmlog record.
void rpmlogOpen(const char *ident, int option, int facility)
Open connection to system logger.
#define RPM_GNUC_PRINTF(format_idx, arg_idx)
void rpmlog(int code, const char *fmt,...) RPM_GNUC_PRINTF(2
Generate a log message using FMT string and option arguments.
rpmlogCallback rpmlogSetCallback(rpmlogCallback cb, rpmlogCallbackData data)
Set rpmlog callback function.
int rpmlogCode(void)
Return error code from last rpmError() message.
enum rpmlogLvl_e rpmlogLvl
RPM Log levels.
void rpmlogPrint(FILE *f)
Print all rpmError() messages.
rpmlogFac_e
facility codes
const char * rpmlogRecMessage(rpmlogRec rec)
Retrieve log message string from rpmlog record.
rpmlogLvl_e
RPM Log levels.
int rpmlogGetNrecs(void)
Return number of rpmError() ressages.