#include <stdarg.h>
Go to the source code of this file.
Data Structures | |
struct | rpmlogRec_s |
Defines | |
#define | H_RPMLOG 1 |
#define | RPMLOG_PRIMASK 0x07 |
#define | RPMLOG_PRI(p) ((p) & RPMLOG_PRIMASK) |
#define | RPMLOG_MAKEPRI(fac, pri) ((((unsigned)(fac)) << 3) | (pri)) |
#define | RPMLOG_NFACILITIES 24 |
#define | RPMLOG_FACMASK 0x03f8 |
#define | RPMLOG_FAC(p) (((p) & RPMLOG_FACMASK) >> 3) |
#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 |
Typedefs | |
typedef enum rpmlogLvl_e | rpmlogLvl |
RPM Log levels. | |
typedef enum rpmlogFac_e | rpmlogFac |
facility codes | |
typedef void(*) | rpmlogCallback (void) |
typedef rpmlogRec_s * | rpmlogRec |
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 } |
RPM Log levels. More... | |
enum | rpmlogFac_e { RPMLOG_KERN = (0<<3), RPMLOG_USER = (1<<3), RPMLOG_MAIL = (2<<3), RPMLOG_DAEMON = (3<<3), RPMLOG_AUTH = (4<<3), RPMLOG_SYSLOG = (5<<3), RPMLOG_LPR = (6<<3), RPMLOG_NEWS = (7<<3), RPMLOG_UUCP = (8<<3), RPMLOG_CRON = (9<<3), RPMLOG_AUTHPRIV = (10<<3), RPMLOG_FTP = (11<<3), RPMLOG_LOCAL0 = (16<<3), RPMLOG_LOCAL1 = (17<<3), RPMLOG_LOCAL2 = (18<<3), RPMLOG_LOCAL3 = (19<<3), RPMLOG_LOCAL4 = (20<<3), RPMLOG_LOCAL5 = (21<<3), RPMLOG_LOCAL6 = (22<<3), RPMLOG_LOCAL7 = (23<<3), RPMLOG_ERRMSG = (((unsigned)( 24 /*!< current number of facilities */ +0))<<3) } |
facility codes More... | |
Functions | |
int | rpmlogGetNrecs (void) |
Return number of rpmError() ressages. | |
void | rpmlogPrint (FILE *f) |
Print all rpmError() messages. | |
void | rpmlogClose (void) |
Close desriptor used to write to system logger. | |
void | rpmlogOpen (const char *ident, int option, int facility) |
Open connection to system logger. | |
int | rpmlogSetMask (int mask) |
Set the log mask level. | |
void | rpmlog (int code, const char *fmt,...) |
Generate a log message using FMT string and option arguments. | |
const char * | rpmlogMessage (void) |
Return text of last rpmError() message. | |
int | rpmlogCode (void) |
Return error code from last rpmError() message. | |
rpmlogCallback | rpmlogSetCallback (rpmlogCallback cb) |
Set rpmlog callback function. | |
FILE * | rpmlogSetFile (FILE *fp) |
Set rpmlog file handle. | |
rpmlogCallback | rpmErrorSetCallback (rpmlogCallback cb) |
Set rpmlog callback function. | |
int | rpmErrorCode (void) |
Return error code from last rpmError() message. | |
const char * | rpmErrorString (void) |
Return text of last rpmError() message. |
Used to unify rpmError() and rpmMessage() interfaces in rpm.
Definition in file rpmlog.h.
#define RPMLOG_CONS 0x02 |
#define RPMLOG_FAC | ( | p | ) | (((p) & RPMLOG_FACMASK) >> 3) |
#define RPMLOG_FACMASK 0x03f8 |
#define RPMLOG_MAKEPRI | ( | fac, | |||
pri | ) | ((((unsigned)(fac)) << 3) | (pri)) |
#define RPMLOG_MASK | ( | pri | ) | (1 << ((unsigned)(pri))) |
#define RPMLOG_NFACILITIES 24 |
#define RPMLOG_NOWAIT 0x10 |
#define RPMLOG_ODELAY 0x04 |
#define RPMLOG_PRI | ( | p | ) | ((p) & RPMLOG_PRIMASK) |
#define RPMLOG_UPTO | ( | pri | ) | ((1 << (((unsigned)(pri))+1)) - 1) |
typedef void(*) rpmlogCallback(void) |
typedef enum rpmlogFac_e rpmlogFac |
facility codes
typedef enum rpmlogLvl_e rpmlogLvl |
RPM Log levels.
priorities/facilities are encoded into a single 32-bit quantity, where the bottom 3 bits are the priority (0-7) and the top 28 bits are the facility (0-big number). Both the priorities and the facilities map roughly one-to-one to strings in the syslogd(8) source code. This mapping is included in this file.
priorities (these are ordered)
typedef struct rpmlogRec_s * rpmlogRec |
enum rpmlogFac_e |
facility codes
enum rpmlogLvl_e |
RPM Log levels.
priorities/facilities are encoded into a single 32-bit quantity, where the bottom 3 bits are the priority (0-7) and the top 28 bits are the facility (0-big number). Both the priorities and the facilities map roughly one-to-one to strings in the syslogd(8) source code. This mapping is included in this file.
priorities (these are ordered)
int rpmErrorCode | ( | void | ) |
Return error code from last rpmError() message.
Definition at line 266 of file rpmlog.c.
References rpmlogCode().
rpmlogCallback rpmErrorSetCallback | ( | rpmlogCallback | cb | ) |
Set rpmlog callback function.
Definition at line 276 of file rpmlog.c.
References rpmlogSetCallback().
const char* rpmErrorString | ( | void | ) |
Return text of last rpmError() message.
Definition at line 271 of file rpmlog.c.
References rpmlogMessage().
void rpmlog | ( | int | code, | |
const char * | fmt, | |||
... | ||||
) |
Generate a log message using FMT string and option arguments.
Definition at line 255 of file rpmlog.c.
References vrpmlog().
Referenced by getGidS(), getGname(), getGnameS(), getUidS(), getUname(), and getUnameS().
void rpmlogClose | ( | void | ) |
int rpmlogCode | ( | void | ) |
Return error code from last rpmError() message.
Definition at line 47 of file rpmlog.c.
References rpmlogRec_s::code, nrecs, and recs.
Referenced by rpmErrorCode().
int rpmlogGetNrecs | ( | void | ) |
Return number of rpmError() ressages.
Definition at line 42 of file rpmlog.c.
References nrecs.
const char* rpmlogMessage | ( | void | ) |
Return text of last rpmError() message.
Definition at line 55 of file rpmlog.c.
References _, rpmlogRec_s::message, nrecs, and recs.
Referenced by rpmErrorString().
void rpmlogOpen | ( | const char * | ident, | |
int | option, | |||
int | facility | |||
) |
void rpmlogPrint | ( | FILE * | f | ) |
Print all rpmError() messages.
f | file handle (NULL uses stderr) |
rpmlogCallback rpmlogSetCallback | ( | rpmlogCallback | cb | ) |
Set rpmlog callback function.
cb | rpmlog callback function |
Definition at line 118 of file rpmlog.c.
References _rpmlogCallback.
Referenced by rpmErrorSetCallback().
FILE* rpmlogSetFile | ( | FILE * | fp | ) |
Set rpmlog file handle.
fp | rpmlog file handle (NULL uses stdout/stderr) |
Definition at line 130 of file rpmlog.c.
References _stdlog.
Referenced by setLogFile().
int rpmlogSetMask | ( | int | mask | ) |
Set the log mask level.
mask | log mask (0 is no operation) |
Definition at line 105 of file rpmlog.c.
References rpmlogMask.