rpm 5.99.91
The RPM Package Manager
Loading...
Searching...
No Matches
rpmlog.h File Reference
#include <stdarg.h>
#include <stdio.h>
#include <rpm/rpmutil.h>
Include dependency graph for rpmlog.h:

Go to the source code of this file.

Macros

#define RPMLOG_PRIMASK   0x07 /* mask to extract priority part (internal) */
#define RPMLOG_PRI(p)
#define RPMLOG_MAKEPRI(fac, pri)
#define RPMLOG_NPRIS   (RPMLOG_DEBUG + 1)
#define RPMLOG_MASK(pri)
#define RPMLOG_UPTO(pri)
#define RPMLOG_PID   0x01
#define RPMLOG_CONS   0x02
#define RPMLOG_ODELAY   0x04
#define RPMLOG_NDELAY   0x08
#define RPMLOG_NOWAIT   0x10
#define RPMLOG_PERROR   0x20
#define RPMLOG_DEFAULT   0x01
#define RPMLOG_EXIT   0x02
#define rpmSetVerbosity(_lvl)
#define rpmIncreaseVerbosity()
#define rpmDecreaseVerbosity()
#define rpmIsNormal()
#define rpmIsVerbose()
#define rpmIsDebug()

Typedefs

typedef enum rpmlogLvl_e rpmlogLvl
typedef struct rpmlogRec_s * rpmlogRec
typedef void * rpmlogCallbackData
typedef int(* rpmlogCallback) (rpmlogRec rec, rpmlogCallbackData data)

Enumerations

enum  rpmlogLvl_e {
  RPMLOG_EMERG = 0 , RPMLOG_ALERT = 1 , RPMLOG_CRIT = 2 , RPMLOG_ERR = 3 ,
  RPMLOG_WARNING = 4 , RPMLOG_NOTICE = 5 , RPMLOG_INFO = 6 , RPMLOG_DEBUG = 7
}

Functions

const char * rpmlogRecMessage (rpmlogRec rec)
rpmlogLvl rpmlogRecPriority (rpmlogRec rec)
int rpmlogGetNrecsByMask (unsigned mask)
int rpmlogGetNrecs (void)
void rpmlogPrintByMask (FILE *f, unsigned mask)
void rpmlogPrint (FILE *f)
void rpmlogClose (void)
void rpmlogOpen (const char *ident, int option, int facility)
int rpmlogSetMask (int mask)
void rpmlog (int code, const char *fmt,...) RPM_GNUC_PRINTF(2
void const char * rpmlogMessage (void)
int rpmlogCode (void)
const char * rpmlogLevelPrefix (rpmlogLvl pri)
rpmlogCallback rpmlogSetCallback (rpmlogCallback cb, rpmlogCallbackData data)
FILE * rpmlogSetFile (FILE *fp)

Detailed Description

Yet Another syslog(3) API clone. Used to unify rpmError() and rpmMessage() interfaces in rpm.

Macro Definition Documentation

◆ rpmDecreaseVerbosity

#define rpmDecreaseVerbosity ( )
Value:
((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
int rpmlogSetMask(int mask)

◆ rpmIncreaseVerbosity

#define rpmIncreaseVerbosity ( )
Value:
((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))

◆ rpmIsDebug

#define rpmIsDebug ( )
Value:
@ RPMLOG_DEBUG
Definition rpmlog.h:32
#define RPMLOG_MASK(pri)
Definition rpmlog.h:44

◆ rpmIsNormal

#define rpmIsNormal ( )
Value:
@ RPMLOG_NOTICE
Definition rpmlog.h:30

◆ rpmIsVerbose

#define rpmIsVerbose ( )
Value:
@ RPMLOG_INFO
Definition rpmlog.h:31

◆ RPMLOG_CONS

#define RPMLOG_CONS   0x02

log on the console if errors in sending

◆ RPMLOG_EXIT

#define RPMLOG_EXIT   0x02

exit after logging

◆ RPMLOG_MAKEPRI

#define RPMLOG_MAKEPRI ( fac,
pri )
Value:
((((unsigned)(fac)) << 3) | (pri))

◆ RPMLOG_MASK

#define RPMLOG_MASK ( pri)
Value:
(1 << ((unsigned)(pri)))

mask for one priority

◆ RPMLOG_NDELAY

#define RPMLOG_NDELAY   0x08

don't delay open

◆ RPMLOG_NOWAIT

#define RPMLOG_NOWAIT   0x10

don't wait for console forks: DEPRECATED

◆ RPMLOG_ODELAY

#define RPMLOG_ODELAY   0x04

delay open until first syslog() (default)

◆ RPMLOG_PERROR

#define RPMLOG_PERROR   0x20

log to stderr as well

◆ RPMLOG_PID

#define RPMLOG_PID   0x01

log the pid with each message

◆ RPMLOG_PRI

#define RPMLOG_PRI ( p)
Value:
((p) & RPMLOG_PRIMASK)

◆ RPMLOG_UPTO

#define RPMLOG_UPTO ( pri)
Value:
((1 << (((unsigned)(pri))+1)) - 1)

all priorities through pri

◆ rpmSetVerbosity

#define rpmSetVerbosity ( _lvl)
Value:
((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
#define RPMLOG_UPTO(pri)
Definition rpmlog.h:45