MONGOC_STRUCTU..._FOR_COMPONENT(3)

πŸ’… MONGOC_STRUCTU..._FOR_COMPONENT(3)

okay so this is a page out of libmongoc (yes, the MongoDB C driver, we love her), and it's all about one very specific little function: mongoc_structured_log_opts_get_max_level_for_component. bestie, the header got truncated by the man page formatter so it literally reads MONGOC_STRUCTU..._FOR_COMPONENT(3) β€” that's not a typo, that's just how it's printed. iconic honestly. πŸŽ€


✨ SYNOPSIS ✨

mongoc_structured_log_level_t
mongoc_structured_log_opts_get_max_level_for_component (const mongoc_structured_log_opts_t *opts,
                                                        mongoc_structured_log_component_t component);

like, she takes your opts, she takes a component, she hands you back a log level. no notes. πŸ’…


🌸 PARAMETERS 🌸

  • opts β€” the structured log options 🫢 β€” and listen, these have to be allocated with mongoc_structured_log_opts_new(), so don't be out here passing random garbage, iykyk.
  • component β€” the log component you're asking about, typed as a mongoc_structured_log_component_t. that's the vibe check of "which part of the library are we talking about rn". πŸ’œ

⭐ RETURNS ⭐

She returns the configured maximum log level for that one specific component, as a mongoc_structured_log_level_t. ✨

And where does that value come from? lowkey could be any of these, no cap:

  • the last value you set with mongoc_structured_log_opts_set_max_level_for_component()
  • the last value you set with mongoc_structured_log_opts_set_max_level_for_all_components()
  • or the default you picked up from environment variables 🌈
🚨 important caveat bestie: if you hand her an invalid or unknown component enum, she returns the lowest log level. so like, don't expect a big fancy answer for a component that isn't real. πŸ™ˆ

SEE ALSO:

  • Structured Logging πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc β€” the whole entire company, credited, slay. πŸ”₯


2009-present, MongoDB, Inc.


okay that's the whole page, mwah πŸ’‹ β€” this was libmongoc version 2.5.6, dated Oct 09 per the footer at the bottom of the original page (the year got kinda eaten by the column formatting, rip 😭). go forth and log responsibly, bestie πŸ¦‹πŸ’–

πŸ“¦ where this page comes from