-/* opkg_message.c - the itsy package management system
+/* opkg_message.c - the opkg package management system
Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
*/
-#include "opkg.h"
+#include "includes.h"
#include "opkg_conf.h"
#include "opkg_message.h"
-
-#include "libopkg.h"
-
-//#define opkg_message(conf, level, fmt, arg...) opkg_cb_message(conf, level, fmt, ## arg)
+#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 (opkg_cb_message)
- {
- va_start (ap, fmt);
- vsnprintf (ts,256,fmt, ap);
- va_end (ap);
- opkg_cb_message(conf,level,ts);
- }
+
+ if (conf && (conf->verbosity < level))
+ return;
+
+ va_start (ap, fmt);
+
+ if (level == OPKG_ERROR) {
+ char msg[256];
+ vsnprintf(msg, 256, fmt, ap);
+ push_error_list(msg);
+ } else
+ vprintf(fmt, ap);
+
+ va_end (ap);
}