rotatory_write()

rotatory_write()#

rotatory_write() writes a log message to the rotatory log file with the specified priority level.

Prototype

int rotatory_write(
    hrotatory_h  hr,
    int          priority,
    const char*  bf,
    size_t       len
);

Parameters

Key

Type

Description

hr

hrotatory_h

Handle to the rotatory log instance.

priority

int

Priority level of the log message, ranging from LOG_EMERG to LOG_AUDIT.

bf

const char*

Pointer to the buffer containing the log message.

len

size_t

Length of the log message in bytes.


Return Value

Returns the number of bytes written on success, or -1 on error.

Notes

If priority is LOG_AUDIT, the message is written without a header. If priority is outside the valid range, it defaults to LOG_DEBUG. The function appends a newline character (\n) to the log message. Internally calls _rotatory() to perform the actual writing.

Prototype

// Not applicable in JS

Prototype

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