From: Michael Tremer Date: Fri, 23 Apr 2021 08:51:25 +0000 (+0000) Subject: pakfire: Log pool debugging to pakfire log X-Git-Tag: 0.9.28~1285^2~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5fa75c89c1ed532d5c4fd01cfd0a9845dbafeb8;p=pakfire.git pakfire: Log pool debugging to pakfire log Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index a3e4772a1..a89058e10 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -313,6 +313,12 @@ static int log_priority(const char* priority) { return 0; } +static void pool_log(Pool* pool, void* data, int type, const char* s) { + Pakfire pakfire = (Pakfire)data; + + DEBUG(pakfire, "pool: %s", s); +} + static int pakfire_populate_pool(Pakfire pakfire) { struct pakfire_db* db; PakfireRepo repo = NULL; @@ -332,6 +338,9 @@ static int pakfire_populate_pool(Pakfire pakfire) { // Set path pool_set_rootdir(pool, pakfire->path); + // Set debug callback + pool_setdebugcallback(pool, pool_log, pakfire); + // Open database in read-only mode and try to load all installed packages r = pakfire_db_open(&db, pakfire, PAKFIRE_DB_READWRITE); if (r)