X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Fopkg_message.c;h=98b3c9df2545dc8c82c10a7547c85249caf677ee;hp=c00dd979a953b198e25096caf27c808798503027;hb=8150da195475d0f868797dc125a138883bcb6ba7;hpb=f4a787e50beb527aeffd847df6b734b29967bd96 diff --git a/libopkg/opkg_message.c b/libopkg/opkg_message.c index c00dd97..98b3c9d 100644 --- a/libopkg/opkg_message.c +++ b/libopkg/opkg_message.c @@ -1,4 +1,4 @@ -/* opkg_message.c - the itsy package management system +/* opkg_message.c - the opkg package management system Copyright (C) 2003 Daniele Nicolodi @@ -14,7 +14,7 @@ */ -#include "opkg.h" +#include "includes.h" #include "opkg_conf.h" #include "opkg_message.h" @@ -26,11 +26,18 @@ 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); + } }