XBPS Library API 20250713
The X Binary Package System
Logging functions

Macros

#define xbps_error_oom()
 Log out of memory condition.

Functions

void xbps_dbg_printf (const char *fmt,...)
 Prints debug messages to stderr.
void xbps_dbg_printf_append (const char *fmt,...)
 Prints debug messages to stderr.
void xbps_verbose_printf (const char *,...) __attribute__((format(printf
 Prints messages to stderr if verbosity is enabled.
void void xbps_error_printf (const char *fmt,...)
 Prints error messages to stderr.
void xbps_warn_printf (const char *fmt,...)
 Prints warning messages to stderr.
int xbps_error_errno (int r, const char *fmt,...)
 Prints formatted log message to stderr and returns error.

Variables

int xbps_debug_level
 The Debug level.

Detailed Description

Use these functions to log errors, warnings and debug messages.

Macro Definition Documentation

◆ xbps_error_oom

#define xbps_error_oom ( )
Value:
xbps_error_errno(ENOMEM, "%s:%d %s: out of memory\n", __FILE__, \
__LINE__, __func__)
int xbps_error_errno(int r, const char *fmt,...)
Prints formatted log message to stderr and returns error.
Definition log.c:118
Returns
Returns -ENOMEM.

Definition at line 776 of file xbps.h.

Referenced by xbps_array_foreach_cb_multi(), and xbps_pkgdb_foreach_cb_multi().

Function Documentation

◆ xbps_dbg_printf()

◆ xbps_dbg_printf_append()

void xbps_dbg_printf_append ( const char * fmt,
... )
Parameters
[in]fmtformat specifier for the message.

Definition at line 59 of file log.c.

References xbps_debug_level.

◆ xbps_verbose_printf()

void xbps_verbose_printf ( const char * ,
... )
Parameters
[in]fmtformat specifier for the message.

References xbps_error_errno(), xbps_error_printf(), xbps_verbose_printf(), and xbps_warn_printf().

Referenced by xbps_verbose_printf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xbps_error_printf()

void void xbps_error_printf ( const char * fmt,
... )
Parameters
[in]fmtformat specifier for the message.

Definition at line 98 of file log.c.

Referenced by xbps_archive_fetch_file_into_fd(), xbps_array_foreach_cb_multi(), xbps_pkgdb_update(), xbps_repo_open(), and xbps_verbose_printf().

Here is the caller graph for this function:

◆ xbps_warn_printf()

void xbps_warn_printf ( const char * fmt,
... )
Parameters
[in]fmtformat specifier for the message.

Definition at line 108 of file log.c.

Referenced by xbps_repo_lock(), and xbps_verbose_printf().

Here is the caller graph for this function:

◆ xbps_error_errno()

int xbps_error_errno ( int r,
const char * fmt,
... )
Parameters
[in]rerrno to be returned.
[in]fmtformat specifier for the error message.
Returns
returns the specified error value r.

Definition at line 118 of file log.c.

Referenced by xbps_pkgdb_lock(), and xbps_verbose_printf().

Here is the caller graph for this function: