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'sQB_LOG_SYSLOG,QB_LOG_STDERR, or whateverqb_log_file_open()handed back to you. pick your vibe. πconf_typeβ the configuration directive, aka "what to configure". it takes either anint32_tor 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 forqb_log_ctlQB_LOG_CONF_IDENT. π«Άargβ the new value for a state-changing configuration directive, ignored otherwise. forQB_LOG_CONF_IDENT, the's'member is the new identifier passed toopenlog(). for all theqb_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:
qb_log_filter_fn_set(3)qb_log_from_external_source_va2(3)qb_log_thread_start(3)qb_log_target_user_data_get(3)qb_log_tags_stringify_fn_set(3)qb_log_file_reopen(3)qb_log_fini(3)qb_log_callsites_dump(3)qb_log_target_user_data_set(3)qb_log_target_format(3)qb_log_thread_priority_set(3)qb_log_facility2int(3)qb_log_callsites_register(3)qb_log_filter_ctl2(3)qb_log_file_close(3)qb_log_format_set(3)qb_log_real_(3)qb_log_from_external_source_va(3)qb_log_callsite_get(3)qb_log_blackbox_write_to_file(3)qb_log_real_va_(3)qb_log_from_external_source(3)qb_log_blackbox_print_from_file(3)qb_log_facility2str(3)qb_log_callsite_get2(3)qb_log_ctl(3)qb_log_filter_ctl(3)qb_log_custom_close(3)qb_log_init(3)qb_log_file_open(3)qb_log_custom_open(3)
π COPYRIGHT π
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
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- fedora 44: libqb-devel 2.0.9-2.fc44 Β· LGPL-2.1-or-later
- ubuntu resolute: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- ubuntu stonking: libqb-dev 2.0.9-1ubuntu1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms