XBPS Library API 20250813
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 *,...)
 Prints messages to stderr if verbosity is enabled.
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:113
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 54 of file log.c.

References xbps_debug_level.

◆ xbps_verbose_printf()

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

Definition at line 80 of file log.c.

◆ xbps_error_printf()

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

Definition at line 93 of file log.c.

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

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 103 of file log.c.

Referenced by xbps_pkgdb_lock(), and xbps_repo_lock().

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 113 of file log.c.

Referenced by xbps_pkgdb_lock().

Here is the caller graph for this function: