QB_LOG_CA...S_REGISTER(3)

✨ QB_LOG_CA...S_REGISTER(3) ✨

okay bestie, welcome to the libqb Programmer's Manual πŸ’– this one's called qb_log_callsites_register and it's giving "my plugin has trust issues" energy. let's get into it 🌸


πŸ’… NAME πŸ’…

qb_log_callsites_register β€” okay so picture this: you're using dynamically loadable modules via dlopen() and you load them after qb_log_init() πŸ™ˆ then after you load the module you will need to do the following to get the filters to work in that module. that's literally it, that's the whole job. she's a fixer πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

#include <qb/qblog.h>

int32_t qb_log_callsites_register(
    struct qb_log_callsite   *_start,
    struct qb_log_callsite   *_stop
);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, here's the vibe, fr fr:

_start = dlsym (dl_handle, QB_ATTR_SECTION_START_STR);
_stop = dlsym (dl_handle, QB_ATTR_SECTION_STOP_STR);
qb_log_callsites_register(_start, _stop);

that's the move. grab your _start and _stop out of the dl_handle with dlsym, then hand them over to qb_log_callsites_register. filters? working. slay ✨


πŸ‘‘ STRUCTURES πŸ‘‘

an instance of this structure is created for each log message with the message-id. iconic behaviour honestly 🫢

struct qb_log_callsite {
    const char   *function;
    const char   *filename;
    const char   *format;
    uint8_t       priority;
    uint32_t      lineno;
    uint32_t      targets;
    uint32_t      tags;
    const char   *message_id;
};

🌈 SEE ALSO 🌈

besties, the whole group chat is here, no cap:


Copyright (c) 2017 Red Hat, Inc.


and that's the whole page, periodt πŸŽ€ mwah πŸ’‹ this lil baddie is brought to you by LIBQB, dated 2025-09-16, and she ate πŸ’…βœ¨

πŸ“¦ where this page comes from