pappl-log - Man Page

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) 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-client(3), pappl-device(3), pappl-job(3), pappl-log(3), pappl-mainline(3), pappl-makeresheader(1), pappl-printer(3), pappl-resource(3), pappl-system(3), https://www.msweet.org/pappl

Referenced By

pappl(1), pappl-client(3), pappl-device(3), pappl-job(3), pappl-mainloop(3), pappl-printer(3), pappl-resource(3), pappl-system(3).

2024-01-22 pappl logging functions