]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Remove logging callback
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Oct 2023 10:12:37 +0000 (10:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Oct 2023 10:12:37 +0000 (10:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c
src/cli/lib/pakfire.c
src/libpakfire/include/pakfire/logging.h
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/pakfire.c
tests/parser/test.c
tests/testsuite.c

index 680c955a9c056c0c0fed7ee6e5c553c4a3f2f68c..74d82ce2887a3567cc839dd56b4b7982c899e3c1 100644 (file)
@@ -21,6 +21,7 @@
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <errno.h>
+#include <syslog.h>
 
 #include <pakfire/archive.h>
 #include <pakfire/build.h>
@@ -232,8 +233,7 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
        Py_BEGIN_ALLOW_THREADS
 
        // Create a new Pakfire instance
-       r = pakfire_create(&self->pakfire, pakfire_ctx, path, arch, fconf, flags,
-               Pakfire_log_callback, self->callbacks.log);
+       r = pakfire_create(&self->pakfire, pakfire_ctx, path, arch, fconf, flags);
 
        Py_END_ALLOW_THREADS
 
index 3e43788bd9dbf7511b57ce22340d3e43f63dd6d5..4133ab7d4a17ff9cb67f148aa2babf882c1b9471 100644 (file)
@@ -100,7 +100,7 @@ int cli_setup_pakfire(struct pakfire** pakfire, struct cli_config* config) {
                goto ERROR;
 
        // Initialize Pakfire
-       r = pakfire_create(&p, ctx, config->root, config->arch, f, config->flags, NULL, NULL);
+       r = pakfire_create(&p, ctx, config->root, config->arch, f, config->flags);
        if (r)
                goto ERROR;
 
index 0fe1b7dcd604296d30910509a1c39408541e7bde..69fda7f7772d51b3ed4a4d1f6f0309edd129f9f3 100644 (file)
 #define PAKFIRE_LOGGING_H
 
 #include <stdarg.h>
-#include <syslog.h>
 
 typedef void (*pakfire_log_callback)(void* data, int priority, const char* file,
        int line, const char* fn, const char* format, va_list args);
 
-#include <pakfire/pakfire.h>
-
 void pakfire_log_stderr(void* data, int priority, const char* file,
        int line, const char* fn, const char* format, va_list args);
 void pakfire_log_syslog(void* data, int priority, const char* file,
@@ -36,7 +33,10 @@ void pakfire_log_syslog(void* data, int priority, const char* file,
 
 #ifdef PAKFIRE_PRIVATE
 
+#include <syslog.h>
+
 #include <pakfire/ctx.h>
+#include <pakfire/pakfire.h>
 
 #define pakfire_ctx_log_condition(ctx, level, r, arg...) \
        do { \
index eed9784044b469a44c2707fcc7b1026c760867a9..cd3ab2941edb53aa8e95ae711b731fedc7577195 100644 (file)
@@ -32,7 +32,6 @@ struct pakfire;
 #include <pakfire/ctx.h>
 #include <pakfire/filelist.h>
 #include <pakfire/key.h>
-#include <pakfire/logging.h>
 #include <pakfire/packagelist.h>
 #include <pakfire/parser.h>
 #include <pakfire/progress.h>
@@ -55,8 +54,7 @@ typedef void (*pakfire_status_callback)(struct pakfire* pakfire, void* data,
        int progress, const char* status);
 
 int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx,
-       const char* path, const char* arch, FILE* conf, int flags,
-       pakfire_log_callback log_callback, void* log_data);
+       const char* path, const char* arch, FILE* conf, int flags);
 
 struct pakfire* pakfire_ref(struct pakfire* pakfire);
 struct pakfire* pakfire_unref(struct pakfire* pakfire);
index 7c01877dc515839a6997ea075ec37f3a8ccd60ff..9a7caf8aeab56514ee9f2ad038d102028cc47f66 100644 (file)
@@ -876,8 +876,7 @@ ERROR:
 }
 
 PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx,
-               const char* path, const char* arch, FILE* conf, int flags,
-               pakfire_log_callback log_callback, void* log_data) {
+               const char* path, const char* arch, FILE* conf, int flags) {
        char tempdir[PATH_MAX] = PAKFIRE_TMP_DIR "/pakfire-root-XXXXXX";
        char private_dir[PATH_MAX];
        int r = 1;
index acac5f7d70c728f6c5f81a27699b5f588fcf1bc0..9bf5a5c4a6bce5baae143782b6587b148d671673 100644 (file)
@@ -55,8 +55,7 @@ int main(int argc, const char* argv[]) {
        pakfire_ctx_set_log_callback(ctx, pakfire_log_stderr, NULL);
 
        // Create a pakfire instance
-       r = pakfire_create(&pakfire, ctx, root, NULL, NULL,
-               PAKFIRE_FLAGS_DEBUG, pakfire_log_stderr, NULL);
+       r = pakfire_create(&pakfire, ctx, root, NULL, NULL, PAKFIRE_FLAGS_DEBUG);
        if (r) {
                fprintf(stderr, "Could not create Pakfire: %m\n");
                goto ERROR;
index 8bbe1c0fca44295a4ef26386963f170dcf38465f..a28115cdc5ee1ff512f185dd6501c3018656787b 100644 (file)
@@ -73,7 +73,7 @@ static int test_run(int i, struct test* t) {
        }
 
        // Create a pakfire instance
-       r = pakfire_create(&t->pakfire, ctx, root, NULL, c, flags, pakfire_log_stderr, NULL);
+       r = pakfire_create(&t->pakfire, ctx, root, NULL, c, flags);
        if (r) {
                LOG("ERROR: Could not initialize pakfire: %m\n");
                goto ERROR;