]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Log pool debugging to pakfire log
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Apr 2021 08:51:25 +0000 (08:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 23 Apr 2021 08:51:25 +0000 (08:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index a3e4772a1b4710240c7a286750e75b393927db7b..a89058e103dbcf2700f119aed7e881f881774c96 100644 (file)
@@ -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)