QB_LOG_CTL2(3)

πŸ’– QB_LOG_CTL2(3) πŸ’–

okay bestie, welcome to qb_log_ctl2 from the libqb Programmer's Manual β€” she's the main character of logging control functions and she brought a friend. ✨


🌸 NAME 🌸

qb_log_ctl2 β€” it's the extension of the main logging control function that also says yes to strings. like, the original one only wanted ints, and this one is like "no babe, bring your char * too, i can handle it". πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <qb/qblog.h>

int32_t qb_log_ctl2(
    /*
     * QB_LOG_SYSLOG, QB_LOG_STDERR or result from qb_log_file_open()
     */
    int32_t            target,
    /*
     * configuration directive ("what to configure") that accepts either
     * int32_t or a null-terminated string argument determining the new value unless
     * ignored for particular directive (compatible directives: those valid for
     * qb_log_ctlQB_LOG_CONF_IDENT)

     */
    enum qb_log_conf   conf_type,
    /*
     * the new value for a state-changing configuration directive, ignored
     * otherwise; for QB_LOG_CONF_IDENT, 's' member as new identifier to openlog(), for
     * all qb_log_ctl-compatible ones, 'i32' member is assumed (although a
     * preferred way is to use that original function directly as it allows for more type
     * safety)
     */
    qb_log_ctl2_arg_t  arg
);

πŸ¦‹ PARAMS πŸ¦‹

  • target β€” this is your destination girlie. it's QB_LOG_SYSLOG, QB_LOG_STDERR, or whatever qb_log_file_open() handed back to you. pick your vibe. 🌈
  • conf_type β€” the configuration directive, aka "what to configure". it takes either an int32_t or a null-terminated string argument, and that argument decides the new value… unless it's ignored for that particular directive. the compatible directives are the ones that are valid for qb_log_ctlQB_LOG_CONF_IDENT. 🫢
  • arg β€” the new value for a state-changing configuration directive, ignored otherwise. for QB_LOG_CONF_IDENT, the 's' member is the new identifier passed to openlog(). for all the qb_log_ctl-compatible ones, the 'i32' member is what gets assumed β€” although honestly, the preferred way is to use that original function directly, because it gives you more type safety. πŸ”₯

πŸ’œ DESCRIPTION πŸ’œ

not me leaving this section empty… the good stuff is literally right below in STRUCTURES. go look. πŸ™ˆ

⭐ STRUCTURES ⭐

the little struct that could, qb_log_ctl2_arg_t, is giving very much "union but make it two fields":

struct qb_log_ctl2_arg_t {
    int32_t       i32;
    const char   *s;
};

and here's the icon that is enum qb_log_conf β€” all thirteen of her little babies, and yes we're listing every single one because nobody gets left behind: πŸ‘‘

enum qb_log_conf {
      QB_LOG_CONF_ENABLED;
      QB_LOG_CONF_FACILITY;
      QB_LOG_CONF_DEBUG;
      QB_LOG_CONF_SIZE;
      QB_LOG_CONF_THREADED;
      QB_LOG_CONF_PRIORITY_BUMP;
      QB_LOG_CONF_STATE_GET;
      QB_LOG_CONF_FILE_SYNC;
      QB_LOG_CONF_EXTENDED;
      QB_LOG_CONF_IDENT;
      QB_LOG_CONF_MAX_LINE_LEN;
      QB_LOG_CONF_ELLIPSIS;
      QB_LOG_CONF_USE_JOURNAL;
};

🌟 NOTE 🌟

bestie listen. you can use the QB_LOG_CTL2_I32 and QB_LOG_CTL2_S macros for a convenient on-the-fly construction of the object you're passing as the arg argument. it's giving effortless. it's giving slay. use them. πŸ’–


πŸ‘‘ SEE ALSO πŸ‘‘

go read her sisters, fr fr, they're all iconic:


Copyright (c) 2017 Red Hat, Inc.


okay that's the whole page bestie, you ate that πŸ’…βœ¨ and just so you know where this came from: it's LIBQB, dated 2025-09-16, and it lives under the name QB_LOG_CTL2(3). periodt. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from