---
name: "pappl-log"
section: "3"
platform: "linux"
package: "pappl"
version: "1.4.12-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pappl-log"
---

# pappl-log(3)

pappl logging functions

## NAME

pappl-log - pappl logging functions

## LIBRARY

Printer Application Framework (libpappl, "pkg-config --cflags --libs pappl")

## SYNOPSIS

**#include \<pappl/pappl.h\>**

*void*\
 **papplLog***(pappl\_system\_t \*system, pappl\_loglevel\_t level, const char \*message, ...);*

*void*\
 **papplLogClient***(pappl\_client\_t \*client, pappl\_loglevel\_t level, const char \*message, ...);*

*void*\
 **papplLogJob***(pappl\_job\_t \*job, pappl\_loglevel\_t level, const char \*message, ...);*

*void*\
 **papplLogPrinter***(pappl\_printer\_t \*printer, pappl\_loglevel\_t level, const char \*message, ...);*

## DESCRIPTION

The **PAPPL** logging functions record messages to the configured log file.

**papplLog** records messages applying to the system as a whole.

**papplLogClient,** **papplLogJob,** and **papplLogPrinter** record messages specific to a client connection, print job, or printer respectively.

The *level* argument specifies a log level from debugging (*PAPPL\_LOGLEVEL\_DEBUG*) to fatal (*PAPPL\_LOGLEVEL\_FATAL*) and is used to determine whether the message is recorded to the log.

The *message* argument specifies the message using a [**printf**(3)](/printf/3.md) format string.

## ENUMERATIONS

### pappl\_loglevel\_e

Log levels

- PAPPL\_LOGLEVEL\_DEBUG

  Debug message

- PAPPL\_LOGLEVEL\_ERROR

  Error message

- PAPPL\_LOGLEVEL\_FATAL

  Fatal message

- PAPPL\_LOGLEVEL\_INFO

  Informational message

- PAPPL\_LOGLEVEL\_UNSPEC

  Not specified

- PAPPL\_LOGLEVEL\_WARN

  Warning message

## FUNCTIONS

### papplLog

Log a message for the system.

```
void papplLog (
    pappl_system_t *system,
    pappl_loglevel_t level,
    const char *message,
    ...
);
```

This function sends a message to the system's log file.  The "level" argument specifies the urgency of the message:

- •

  **PAPPL\_LOGLEVEL\_DEBUG**: A debugging message.

- •

  **PAPPL\_LOGLEVEL\_ERROR**: An error message.

- •

  **PAPPL\_LOGLEVEL\_FATAL**: A fatal error message.

- •

  **PAPPL\_LOGLEVEL\_INFO**: An informational message.

- •

  **PAPPL\_LOGLEVEL\_WARN**: A warning message.

The "message" argument specifies a **printf**-style format string.  Values logged using the "%c" and "%s" format specifiers are sanitized to not contain control characters.

### papplLogClient

Log a message for a client.

```
void papplLogClient (
    pappl_client_t *client,
    pappl_loglevel_t level,
    const char *message,
    ...
);
```

This function sends a client message to the system's log file.  The "level" argument specifies the urgency of the message:

- •

  **PAPPL\_LOGLEVEL\_DEBUG**: A debugging message.

- •

  **PAPPL\_LOGLEVEL\_ERROR**: An error message.

- •

  **PAPPL\_LOGLEVEL\_FATAL**: A fatal error message.

- •

  **PAPPL\_LOGLEVEL\_INFO**: An informational message.

- •

  **PAPPL\_LOGLEVEL\_WARN**: A warning message.

The "message" argument specifies a **printf**-style format string.  Values logged using the "%c" and "%s" format specifiers are sanitized to not contain control characters.

### papplLogDevice

Log a device error for the system...

```
void papplLogDevice (
    const char *message,
    void *data
);
```

This function sends a device error message to the system's log file.

### papplLogJob

Log a message for a job.

```
void papplLogJob (
    pappl_job_t *job,
    pappl_loglevel_t level,
    const char *message,
    ...
);
```

This function sends a job message to the system's log file.  The "level" argument specifies the urgency of the message:

- •

  **PAPPL\_LOGLEVEL\_DEBUG**: A debugging message.

- •

  **PAPPL\_LOGLEVEL\_ERROR**: An error message.

- •

  **PAPPL\_LOGLEVEL\_FATAL**: A fatal error message.

- •

  **PAPPL\_LOGLEVEL\_INFO**: An informational message.

- •

  **PAPPL\_LOGLEVEL\_WARN**: A warning message.

The "message" argument specifies a **printf**-style format string.  Values logged using the "%c" and "%s" format specifiers are sanitized to not contain control characters.

### papplLogPrinter

Log a message for a printer.

```
void papplLogPrinter (
    pappl_printer_t *printer,
    pappl_loglevel_t level,
    const char *message,
    ...
);
```

This function sends a printer message to the system's log file.  The "level" argument specifies the urgency of the message:

- •

  **PAPPL\_LOGLEVEL\_DEBUG**: A debugging message.

- •

  **PAPPL\_LOGLEVEL\_ERROR**: An error message.

- •

  **PAPPL\_LOGLEVEL\_FATAL**: A fatal error message.

- •

  **PAPPL\_LOGLEVEL\_INFO**: An informational message.

- •

  **PAPPL\_LOGLEVEL\_WARN**: A warning message.

The "message" argument specifies a **printf**-style format string.  Values logged using the "%c" and "%s" format specifiers are sanitized to not contain control characters.

## TYPES

### pappl\_loglevel\_t

Log levels

```
typedef enum pappl_loglevel_e pappl_loglevel_t;
```

## SEE ALSO

[**pappl**(1)](/pappl/1.md), [**pappl-client**(3)](/pappl-client/3.md), [**pappl-device**(3)](/pappl-device/3.md), [**pappl-job**(3)](/pappl-job/3.md), [**pappl-log**(3)](/pappl-log/3.md), **pappl-mainline**(3), [**pappl-makeresheader**(1)](/pappl-makeresheader/1.md), [**pappl-printer**(3)](/pappl-printer/3.md), [**pappl-resource**(3)](/pappl-resource/3.md), [**pappl-system**(3)](/pappl-system/3.md), https://www.msweet.org/pappl

## COPYRIGHT

Copyright © 2019-2022 by Michael R Sweet.

**PAPPL** is licensed under the Apache License Version 2.0 with an (optional) exception to allow linking against GPL2/LGPL2 software (like older versions of CUPS), so it can be used *freely* in any project you'd like. See the files "LICENSE" and "NOTICE" in the source distribution for more information.
