---
name: "libalpm_log"
section: "3"
platform: "linux"
package: "pacman"
version: "7.1.0.r9.g54d9411-3"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libalpm_log"
---

# libalpm\_log(3)

Logging Functions - Functions to log using libalpm

## NAME

libalpm\_log - Logging Functions

 \- Functions to log using libalpm

## SYNOPSIS

### 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.

### 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

### 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**

*ctx* user-provided context \
 *level* the currently set loglevel \
 *fmt* the printf like format string \
 *args* printf like arguments

## Enumeration Type Documentation

### enum alpm\_loglevel\_t

Logging Levels.

**Enumerator**

- ***ALPM\_LOG\_ERROR***

  Error.

- ***ALPM\_LOG\_WARNING***

  Warning.

- ***ALPM\_LOG\_DEBUG***

  Debug.

- ***ALPM\_LOG\_FUNCTION***

  Function.

## Function Documentation

### int alpm\_logaction (alpm\_handle\_t \* handle, const char \* prefix, const char \* fmt, ...)

A printf-like function for logging.

**Parameters**

*handle* the context handle \
 *prefix* caller-specific prefix for the log \
 *fmt* output format

**Returns**

0 on success, -1 on error (pm\_errno is set accordingly)

References **alpm\_logaction()**.

Referenced by **alpm\_logaction()**.

## Author

Generated automatically by Doxygen for libalpm from the source code.
