# 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 */
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);
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;