summaryrefslogtreecommitdiffstats
path: root/libopkg
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-02 20:38:39 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-02 20:38:39 (EST)
commit76bc3faf15a5f22dd77b89c44b36f42a3670fe9f (patch)
tree918599b9680138ccaae0298f9972335ebe60da85 /libopkg
parentf8b2c761bde10606fe00abb3c60fb3650c617747 (diff)
Stop using opkg_cb_message.
git-svn-id: http://opkg.googlecode.com/svn/trunk@243 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r--libopkg/opkg_message.c28
-rw-r--r--libopkg/opkg_message.h3
2 files changed, 13 insertions, 18 deletions
diff --git a/libopkg/opkg_message.c b/libopkg/opkg_message.c
index 98b3c9d..fc4a196 100644
--- a/libopkg/opkg_message.c
+++ b/libopkg/opkg_message.c
@@ -17,27 +17,25 @@
#include "includes.h"
#include "opkg_conf.h"
#include "opkg_message.h"
-
-opkg_message_callback opkg_cb_message = NULL;
+#include "opkg_error.h"
+#include "opkg_utils.h"
void
opkg_message (opkg_conf_t * conf, message_level_t level, char *fmt, ...)
{
va_list ap;
- char ts[256];
+
+ if (conf && (conf->verbosity < level))
+ return;
va_start (ap, fmt);
- vsnprintf (ts,256,fmt, ap);
- va_end (ap);
- if (opkg_cb_message)
- {
- opkg_cb_message(conf,level,ts);
- }
- else
- {
- char *level_s[5] = {"ERROR", "NOTICE", "INFO", "DEBUG", "DEBUG2"};
- if (level <= conf->verbosity)
- printf ("opkg-%s: %s", level_s[level], ts);
- }
+ if (level == OPKG_ERROR) {
+ char msg[256];
+ vsnprintf(msg, 256, fmt, ap);
+ push_error_list(&error_list, msg);
+ } else
+ vprintf(fmt, ap);
+
+ va_end (ap);
}
diff --git a/libopkg/opkg_message.h b/libopkg/opkg_message.h
index fc6920c..2ca58d8 100644
--- a/libopkg/opkg_message.h
+++ b/libopkg/opkg_message.h
@@ -26,9 +26,6 @@ typedef enum {
OPKG_DEBUG2, /* more debug level message */
} message_level_t;
-typedef int (*opkg_message_callback)(opkg_conf_t *conf, message_level_t level,
- char *msg);
-
extern void opkg_message(opkg_conf_t *conf, message_level_t level, char *fmt, ...);
#endif /* _OPKG_MESSAGE_H_ */