]> git.ipfire.org Git - pakfire.git/commitdiff
logging: Remove the last bits of the Pakfire logger
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Oct 2024 14:37:52 +0000 (14:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 25 Oct 2024 14:37:52 +0000 (14:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/logging.h
src/libpakfire/include/pakfire/pakfire.h
src/libpakfire/pakfire.c

index ff25918d772971155b97c8912cbaeeae2a28011c..9beab05924f2d324e40c8c79a2a763802fed84c6 100644 (file)
@@ -59,24 +59,5 @@ static inline void __attribute__((always_inline, format(printf, 2, 3)))
 #      define CTX_DEBUG pakfire_ctx_log_null
 #endif
 
-#define PAKFIRE_INFO(pakfire, arg...) pakfire_log_condition(pakfire, LOG_INFO, ## arg)
-#define PAKFIRE_ERROR(pakfire, arg...) pakfire_log_condition(pakfire, LOG_ERR, ## arg)
-
-#define pakfire_log_condition(pakfire, level, arg...) \
-       do { \
-               if (pakfire_get_log_level(pakfire) >= level) \
-                       pakfire_log(pakfire, level, __FILE__, __LINE__, __FUNCTION__, ## arg); \
-       } while (0)
-
-// This function does absolutely nothing
-static inline void __attribute__((always_inline, format(printf, 2, 3)))
-       pakfire_log_null(struct pakfire* pakfire, const char *format, ...) {}
-
-#ifdef ENABLE_DEBUG
-#      define PAKFIRE_DEBUG(pakfire, arg...) pakfire_log_condition(pakfire, LOG_DEBUG, ## arg)
-#else
-#      define PAKFIRE_DEBUG pakfire_log_null
-#endif
-
 #endif /* PAKFIRE_PRIVATE */
 #endif /* PAKFIRE_LOGGING_H */
index 02bf2755eaa29b8eb57756a689dbd21e1a374145..ce44b64b9f2e00965d05c1067f66099d0597217d 100644 (file)
@@ -112,13 +112,6 @@ gid_t pakfire_gid(struct pakfire* pakfire);
 const struct pakfire_subid* pakfire_subuid(struct pakfire* pakfire);
 const struct pakfire_subid* pakfire_subgid(struct pakfire* pakfire);
 
-// Logging
-
-int pakfire_get_log_level(struct pakfire* pakfire);
-
-void pakfire_log(struct pakfire* pakfire, int level, const char* file, int line,
-       const char* fn, const char* format, ...) __attribute__((format(printf, 6, 7)));
-
 struct pakfire_config* pakfire_get_config(struct pakfire* pakfire);
 
 int pakfire_confirm(struct pakfire* pakfire, const char* message, const char* question);
index 5116d53441ae63c9f9fc5a1d4e9ce604b82a90f6..cf47b02c48a8d591618cd5b85998c8ec300a2bb7 100644 (file)
@@ -1523,29 +1523,6 @@ PAKFIRE_EXPORT int pakfire_search(struct pakfire* pakfire, const char* what, int
                SEARCH_SUBSTRING|SEARCH_NOCASE);
 }
 
-// Logging
-
-int pakfire_get_log_level(struct pakfire* pakfire) {
-       return pakfire_ctx_get_log_level(pakfire->ctx);
-}
-
-void pakfire_log(struct pakfire* pakfire, int priority,
-               const char* file, int line, const char* fn, const char* format, ...) {
-       char* buffer = NULL;
-       va_list args;
-       int r;
-
-       va_start(args, format);
-       r = vasprintf(&buffer, format, args);
-       va_end(args);
-
-       if (r < 0)
-               return;
-
-       // Pass on to the context logger
-       pakfire_ctx_log(pakfire->ctx, priority, file, line, fn, "%s", buffer);
-}
-
 static const char* pakfire_user_lookup(void* data, la_int64_t uid) {
        struct pakfire* pakfire = (struct pakfire*)data;