rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions
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)   ((p) & RPMLOG_PRIMASK)
 
#define RPMLOG_MAKEPRI(fac, pri)   ((((unsigned)(fac)) << 3) | (pri))
 
#define RPMLOG_NPRIS   (RPMLOG_DEBUG + 1)
 
#define RPMLOG_MASK(pri)   (1 << ((unsigned)(pri)))
 
#define RPMLOG_UPTO(pri)   ((1 << (((unsigned)(pri))+1)) - 1)
 
#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)    ((void)rpmlogSetMask( RPMLOG_UPTO( RPMLOG_PRI(_lvl))))
 
#define rpmIncreaseVerbosity()    ((void)rpmlogSetMask(((((unsigned)(rpmlogSetMask(0) & 0xff)) << 1) | 1)))
 
#define rpmDecreaseVerbosity()    ((void)rpmlogSetMask((((int)(rpmlogSetMask(0) & 0xff)) >> 1)))
 
#define rpmIsNormal()    (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_NOTICE ))
 
#define rpmIsVerbose()    (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_INFO ))
 
#define rpmIsDebug()    (rpmlogSetMask(0) >= RPMLOG_MASK( RPMLOG_DEBUG ))
 

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

◆ RPMLOG_CONS

#define RPMLOG_CONS   0x02

log on the console if errors in sending

◆ RPMLOG_EXIT

#define RPMLOG_EXIT   0x02

exit after logging

◆ RPMLOG_MASK

#define RPMLOG_MASK (   pri)    (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_UPTO

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

all priorities through pri