capture_log_write()

capture_log_write()#

capture_log_write() processes log messages, comparing them against expected log messages and categorizing them as expected or unexpected.

Prototype

int capture_log_write(
    void        *v,
    int         priority,
    const char  *bf,
    size_t      len
);

Parameters

Key

Type

Description

v

void *

Unused parameter, typically reserved for user-defined data.

priority

int

Log priority level, typically used for filtering log messages.

bf

const char *

Log message content in JSON format.

len

size_t

Length of the log message.


Return Value

Returns -1 to indicate that the log message has been processed internally.

Notes

If a log message matches an expected message, it is removed from the expected list. Otherwise, it is added to the unexpected log messages list.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples