From: Michael Tremer Date: Sat, 5 Oct 2024 14:54:25 +0000 (+0000) Subject: cli: build: No longer use the build logger X-Git-Tag: 0.9.30~1152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0e579304b6111159f1e90163f9a365af3046116;p=pakfire.git cli: build: No longer use the build logger We have so many loggers and we need to remove a few... Signed-off-by: Michael Tremer --- diff --git a/src/cli/lib/build.c b/src/cli/lib/build.c index cb8d9c778..c5e070303 100644 --- a/src/cli/lib/build.c +++ b/src/cli/lib/build.c @@ -104,20 +104,15 @@ static error_t parse(int key, char* arg, struct argp_state* state, void* data) { return 0; } -static int log_callback(struct pakfire_build* build, void* data, - int priority, int error, const char* file, int line, const char* function, const char* format, ...) { +static void log_callback(void* data, int priority, const char* file, int line, + const char* function, const char* format, va_list args) { char* buffer = NULL; - va_list args; int r; // Format the message - va_start(args, format); r = vasprintf(&buffer, format, args); - va_end(args); - - // Fail if we could not format the message if (r < 0) - return r; + return; switch (priority) { // Highlight any error messages @@ -134,8 +129,6 @@ static int log_callback(struct pakfire_build* build, void* data, // Cleanup if (buffer) free(buffer); - - return 0; } int cli_build(void* data, int argc, char* argv[]) { @@ -155,6 +148,9 @@ int cli_build(void* data, int argc, char* argv[]) { if (r) goto ERROR; + // Replace the logger + pakfire_ctx_set_log_callback(cli_config->ctx, log_callback, NULL); + // Setup pakfire r = cli_setup_pakfire(&pakfire, cli_config); if (r) @@ -167,9 +163,6 @@ int cli_build(void* data, int argc, char* argv[]) { goto ERROR; } - // Set log callback - pakfire_build_set_log_callback(build, log_callback, NULL); - // Set target if (config.target) { r = pakfire_build_set_target(build, config.target);