libalpm
Arch Linux Package Manager Library
Logging Functions

Functions to log using libalpm More...

Collaboration diagram for Logging Functions:

Typedefs

typedef void(* alpm_cb_log) (void *ctx, alpm_loglevel_t level, const char *fmt, va_list args)
 The callback type for logging.
 

Enumerations

enum  alpm_loglevel_t { ALPM_LOG_ERROR = 1 , ALPM_LOG_WARNING = (1 << 1) , ALPM_LOG_DEBUG = (1 << 2) , ALPM_LOG_FUNCTION = (1 << 3) }
 Logging Levels. More...
 

Functions

int alpm_logaction (alpm_handle_t *handle, const char *prefix, const char *fmt,...) __attribute__((format(printf
 A printf-like function for logging.
 

Detailed Description

Functions to log using libalpm

Typedef Documentation

◆ alpm_cb_log

typedef void(* alpm_cb_log) (void *ctx, alpm_loglevel_t level, const char *fmt, va_list args)

The callback type for logging.

libalpm will call this function whenever something is to be logged. many libalpm will produce log output. Additionally any calls to alpm_logaction will also call this callback.

Parameters
ctxuser-provided context
levelthe currently set loglevel
fmtthe printf like format string
argsprintf like arguments

Enumeration Type Documentation

◆ alpm_loglevel_t

Logging Levels.

Enumerator
ALPM_LOG_ERROR 

Error.

ALPM_LOG_WARNING 

Warning.

ALPM_LOG_DEBUG 

Debug.

ALPM_LOG_FUNCTION 

Function.

Function Documentation

◆ alpm_logaction()

int alpm_logaction ( alpm_handle_t * handle,
const char * prefix,
const char * fmt,
... )

A printf-like function for logging.

Parameters
handlethe context handle
prefixcaller-specific prefix for the log
fmtoutput format
Returns
0 on success, -1 on error (pm_errno is set accordingly)

Referenced by alpm_trans_commit(), commit_single_pkg(), extract_single_file(), perform_extraction(), try_rename(), and unlink_file().