diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-12-07 14:00:34 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-12-07 14:00:34 +0200 |
commit | 80f76a471c1b91feb453dead5053bfcc60591ca1 (patch) | |
tree | 021cbfd4a606a5ae72139aa1428b01445646c3a4 /rpmio | |
parent | 037ceff668aca5985870e4c6cf5250adbddc4dae (diff) | |
download | rpm-80f76a471c1b91feb453dead5053bfcc60591ca1.tar.gz rpm-80f76a471c1b91feb453dead5053bfcc60591ca1.tar.bz2 rpm-80f76a471c1b91feb453dead5053bfcc60591ca1.zip |
Add getter methods for rpmlogRec items (message + level)
Diffstat (limited to 'rpmio')
-rw-r--r-- | rpmio/rpmlog.c | 13 | ||||
-rw-r--r-- | rpmio/rpmlog.h | 14 |
2 files changed, 27 insertions, 0 deletions
diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c index 7dbc91171..73d7c4029 100644 --- a/rpmio/rpmlog.c +++ b/rpmio/rpmlog.c @@ -36,6 +36,18 @@ const char * rpmlogMessage(void) return _("(no error)"); } +const char * rpmlogRecMessage(rpmlogRec rec) +{ + assert(rec != NULL); + return (rec->message); +} + +rpmlogLvl rpmlogRecPriority(rpmlogRec rec) +{ + assert(rec != NULL); + return (rec->pri); +} + void rpmlogPrint(FILE *f) { int i; @@ -171,6 +183,7 @@ static void vrpmlog (unsigned code, const char *fmt, va_list ap) int msgnb = BUFSIZ, nb; int cbrc = RPMLOG_DEFAULT; int needexit = 0; + struct rpmlogRec_s rec; if ((mask & rpmlogMask) == 0) diff --git a/rpmio/rpmlog.h b/rpmio/rpmlog.h index ffeeeeeb9..3a3dc7b60 100644 --- a/rpmio/rpmlog.h +++ b/rpmio/rpmlog.h @@ -159,6 +159,20 @@ RPMCODE facilitynames[] = */ typedef struct rpmlogRec_s * rpmlogRec; +/** \ingroup rpmlog + * Retrieve log message string from rpmlog record + * @param rec rpmlog record + * @return log message + */ +const char * rpmlogRecMessage(rpmlogRec rec); + +/** \ingroup rpmlog + * Retrieve log priority from rpmlog record + * @param rec rpmlog record + * @return log priority + */ +rpmlogLvl rpmlogRecPriority(rpmlogRec rec); + typedef void * rpmlogCallbackData; /** \ingroup rpmlog |