Main Page Modules Data Structures File List Data Fields Globals Related Pages

# rpmio/rpmlog.h File Reference

Yet Another syslog(3) API clone. More...

`#include <stdarg.h>`

Go to the source code of this file.

## 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 /*!< current number of facilities */
#define | RPMLOG_FACMASK 0x03f8 /*!< mask to extract facility part */
#define | RPMLOG_FAC(p) (((p) & RPMLOG_FACMASK) >> 3)
#define | RPMLOG_MASK(pri) (1 << ((unsigned)(pri))) /*!< mask for one priority */
#define | RPMLOG_UPTO(pri) ((1 << (((unsigned)(pri))+1)) - 1) /*!< all priorities through pri */
#define | RPMLOG_PID 0x01 /*!< log the pid with each message */
#define | RPMLOG_CONS 0x02 /*!< log on the console if errors in sending */
#define | RPMLOG_ODELAY 0x04 /*!< delay open until first syslog() (default) */

## Typedefs

typedef enum rpmlogLvl_e | rpmlogLvl
| RPM Log levels. More...
typedef enum rpmlogFac_e | rpmlogFac
| facility codes. More...

## 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...

## Detailed Description

Yet Another syslog(3) API clone.

Used to unify rpmError() and rpmMessage() interfaces in rpm.

Definition in file rpmlog.h.

## Define Documentation

#define H_RPMLOG 1

| Definition at line 2 of file rpmlog.h.

#define RPMLOG_CONS 0x02 /*!< log on the console if errors in sending */

| Definition at line 146 of file rpmlog.h.

#define RPMLOG_FAC | ( | p |  | ) | (((p) & RPMLOG_FACMASK) >> 3)

| Definition at line 101 of file rpmlog.h.

#define RPMLOG_FACMASK 0x03f8 /*!< mask to extract facility part */

| Definition at line 100 of file rpmlog.h.

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

| Definition at line 38 of file rpmlog.h.

#define RPMLOG_MASK | ( | pri |  | ) | (1 << ((unsigned)(pri))) /*!< mask for one priority */

| Definition at line 136 of file rpmlog.h.

#define RPMLOG_NFACILITIES 24 /*!< current number of facilities */

#define RPMLOG_ODELAY 0x04 /*!< delay open until first syslog() (default) */

| Definition at line 147 of file rpmlog.h.

#define RPMLOG_PID 0x01 /*!< log the pid with each message */

| Definition at line 145 of file rpmlog.h.

#define RPMLOG_PRI | ( | p |  | ) | ((p) & RPMLOG_PRIMASK)

| Definition at line 37 of file rpmlog.h.

#define RPMLOG_PRIMASK 0x07

| Definition at line 35 of file rpmlog.h.

#define RPMLOG_UPTO | ( | pri |  | ) | ((1 << (((unsigned)(pri))+1)) - 1) /*!< all priorities through pri */

| Definition at line 137 of file rpmlog.h.

## Typedef Documentation

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)

## Enumeration Type Documentation

enum rpmlogFac_e

facility codes.

Enumeration values:

  RPMLOG_KERN | kernel messages
  RPMLOG_USER | random user-level messages
  RPMLOG_MAIL | mail system
  RPMLOG_DAEMON | system daemons
  RPMLOG_AUTH | security/authorization messages
  RPMLOG_SYSLOG | messages generated internally by syslogd
  RPMLOG_LPR | line printer subsystem
  RPMLOG_NEWS | network news subsystem
  RPMLOG_UUCP | UUCP subsystem
  RPMLOG_CRON | clock daemon
  RPMLOG_AUTHPRIV | security/authorization messages (private)
  RPMLOG_FTP | ftp daemon
  RPMLOG_LOCAL0 | reserved for local use
  RPMLOG_LOCAL1 | reserved for local use
  RPMLOG_LOCAL2 | reserved for local use
  RPMLOG_LOCAL3 | reserved for local use
  RPMLOG_LOCAL4 | reserved for local use
  RPMLOG_LOCAL5 | reserved for local use
  RPMLOG_LOCAL6 | reserved for local use
  RPMLOG_LOCAL7 | reserved for local use
  RPMLOG_ERRMSG |

Definition at line 71 of file rpmlog.h.

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)

Enumeration values:

  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

Definition at line 23 of file rpmlog.h.