-/* 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)
+opkg_message_callback opkg_cb_message = NULL;
void
opkg_message (opkg_conf_t * conf, message_level_t level, char *fmt, ...)
va_list ap;
char ts[256];
+ va_start (ap, fmt);
+ vsnprintf (ts,256,fmt, ap);
+ va_end (ap);
+
if (opkg_cb_message)
{
- va_start (ap, fmt);
- vsnprintf (ts,256,fmt, ap);
- va_end (ap);
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);
+ }
}