QB_LOG_FR...NAL_SOURCE(3)

πŸ’– QB_LOG_FR...NAL_SOURCE(3) πŸ’–

okay so bestie, we're in the libqb Programmer's Manual today and this one is literally the ✨bridge✨ function β€” it's how you pull logs in from other code (think libraries πŸ‘€) that hand you a callback stuffed with their own log messages. no cap.


🌸 NAME 🌸

qb_log_from_external_source β€” this function is to import logs from other code (like libraries) that provide a callback with their logs. fr fr that's the whole job description πŸ’…


✨ SYNOPSIS ✨

#include <qb/qblog.h>

void qb_log_from_external_source(
    const char   *function,  /* originating function name */
    const char   *filename,  /* originating filename */
    const char   *format,    /* format string */
    uint8_t       priority,  /* this takes syslog priorities. */
    uint32_t      lineno,    /* file line number */
    /*
     * this is a uint32_t that you can use with
     * qb_log_tags_stringify_fn_set() to "tag" a log message with a feature or sub-system then you can use
     * "%g" in the format specifer to print it out.
     */
    uint32_t      tags,
    ...
);

like, look at that signature. it ate. πŸŽ€


πŸ¦‹ PARAMS πŸ¦‹

  • function β€” originating function name
  • filename β€” originating filename
  • format β€” format string
  • priority β€” this takes syslog priorities.
  • lineno β€” file line number
  • tags β€” this is a uint32_t that you can use with qb_log_tags_stringify_fn_set() to "tag" a log message with a feature or sub-system then you can use "%g" in the format specifer to print it out.

(null)

yeah girl, that last line is just... sitting there. iykyk. moving on πŸ™ˆ


πŸ’œ DESCRIPTION πŸ’œ

this is the function you call when some other chunk of code β€” a library, a dependency, a mysterious little guy you didn't write β€” gives you a callback full of logs and you wanna funnel those straight into libqb. iconic behavior honestly πŸ‘‘

πŸ“Œ NOTE πŸ“Œ

okay so heads up bestie: the performance of this will not impress you 😭 because the filtering is done on each log message, not beforehand. so try doing basic pre-filtering. like, protect your CPU. she's trying her best. 🫢

🌈 SEE ALSO 🌈

the whole extended family, in all their glory:


Copyright (c) 2017 Red Hat, Inc.


and that's the whole page, bestie!! πŸ’– this dropped as part of libqb with the 2025-09-16 date on it, and you read the entire thing, so slay. go log something. periodt. βœ¨πŸ¦‹πŸ’…

πŸ“¦ where this page comes from