RPM Logging facilities.
More...
RPM Logging facilities.
| #define RPMLOG_DEFAULT 0x01 |
Option flags for callback return value.perform default logging
| typedef int(* rpmlogCallback) (rpmlogRec rec, rpmlogCallbackData data) |
- Parameters
-
| rec | rpmlog record |
| data | private callback data |
- Returns
- flags to define further behavior: RPMLOG_DEFAULT to perform default logging, RPMLOG_EXIT to exit after processing, 0 to return after callback
RPM Log levels. Priorities are encoded into bottom 3 bits of a single 32 bit quantity. The top 28 bits are currently unused.
RPM Log levels. Priorities are encoded into bottom 3 bits of a single 32 bit quantity. The top 28 bits are currently unused.
| Enumerator |
|---|
| RPMLOG_EMERG |
system is unusable
|
| RPMLOG_ALERT |
action must be taken immediately
|
| RPMLOG_CRIT |
critical conditions
|
| RPMLOG_ERR |
error conditions
|
| RPMLOG_WARNING |
warning conditions
|
| RPMLOG_NOTICE |
normal but significant condition
|
| RPMLOG_INFO |
informational
|
| RPMLOG_DEBUG |
debug-level messages
|
| void rpmlog |
( |
int |
code, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
Generate a log message using FMT string and option arguments.
| void rpmlogClose |
( |
void |
| ) |
|
Close desriptor used to write to system logger.
- Todo:
- Implement.
Return error code from last rpmError() message.
- Deprecated:
- Perl-RPM needs, what's really needed is predictable, non-i18n encumbered, error text that can be retrieved through rpmlogMessage() and parsed IMHO.
- Returns
- code from last message
| int rpmlogGetNrecs |
( |
void |
| ) |
|
Return number of rpmError() ressages.
- Returns
- number of messages
| int rpmlogGetNrecsByMask |
( |
unsigned |
mask | ) |
|
Return number of rpmError() messages matching a log mask.
- Parameters
-
| mask | log mask to filter by (0 is no filtering) |
- Returns
- number of messages matching the mask
| const char* rpmlogLevelPrefix |
( |
rpmlogLvl |
pri | ) |
|
Return translated prefix string (if any) given log level.
- Parameters
-
- Returns
- message prefix (or "" for none)
| void const char* rpmlogMessage |
( |
void |
| ) |
|
Return text of last rpmError() message.
- Returns
- text of last message
| void rpmlogOpen |
( |
const char * |
ident, |
|
|
int |
option, |
|
|
int |
facility |
|
) |
| |
Open connection to system logger.
- Todo:
- Implement.
| void rpmlogPrint |
( |
FILE * |
f | ) |
|
Print all rpmError() messages.
- Parameters
-
| f | file handle (NULL uses stderr) |
| void rpmlogPrintByMask |
( |
FILE * |
f, |
|
|
unsigned |
mask |
|
) |
| |
Print all rpmError() messages matching a log mask.
- Parameters
-
| f | file handle (NULL uses stderr) |
| mask | log mask to filter by (0 is no filtering) |
| const char* rpmlogRecMessage |
( |
rpmlogRec |
rec | ) |
|
Retrieve log message string from rpmlog record
- Parameters
-
- Returns
- log message
Retrieve log priority from rpmlog record
- Parameters
-
- Returns
- log priority
Set rpmlog callback function.
- Parameters
-
| cb | rpmlog callback function |
| data | callback private (user) data |
- Returns
- previous rpmlog callback function
| FILE* rpmlogSetFile |
( |
FILE * |
fp | ) |
|
Set rpmlog file handle.
- Parameters
-
| fp | rpmlog file handle (NULL uses stdout/stderr) |
- Returns
- previous rpmlog file handle
| int rpmlogSetMask |
( |
int |
mask | ) |
|
Set the log mask level.
- Parameters
-
| mask | log mask (0 is no operation) |
- Returns
- previous log mask