MONGOC_STRUCTURED_LOG_FUNC_T(3)
β¨ MONGOC_STRUCTURED_LOG_FUNC_T(3) β¨
okay bestie so this one's from libmongoc and it's literally just a typedef for a callback π it's short, it's sweet, and it's the glue that makes structured logging pop off π
πΈ SYNOPSIS πΈ
typedef void (*mongoc_structured_log_func_t)
(const mongoc_structured_log_entry_t *entry, void *user_data);
So this is the callback function you hand over to mongoc_structured_log_opts_set_handler() β like, that's its whole job, that's its moment π it gets called, it does the thing, it exits, main character energy fr β¨
β οΈ tea time, and this part matters: structured log handlers must be thread-safe if they're gonna be used with mongoc_client_pool_t π no exceptions, no "but it worked on my machine", please.
π«Ά and also: handlers must avoid unbounded recursion β preferably by avoiding the use of any libmongoc client or pool which uses the same handler. like, don't call yourself through the thing that calls you, that's a spiral and nobody's got time for that π
π¦ PARAMETERS π¦
entryβ amongoc_structured_log_entry_tpointer, and here's the catch πΈ it's only valid during the handler invocation. so if you're thinking about stashing it somewhere for later... no bestie, don't, it's a now-thing, not a forever-thing πuser_dataβ optional user data, and it comes straight frommongoc_structured_log_opts_set_handler()π your little payload, your little gift, passed right back to you π
π SEE ALSO π
- Structured Logging β go read it, iykyk πβ¨
π AUTHOR π
MongoDB, Inc β yeah, them π iconic behavior tbh
β COPYRIGHT β
2009-present, MongoDB, Inc. β no cap, that's the line, copy it exactly if you need it π«Ά
and that's the whole page, bestie π§ it's giving "small file, big responsibility" ngl π₯
signing off from libmongoc version 2.5.6, dated Oct 09, 2026 β mwah, slay, periodt ππ
π¦ where this page comes from
- epel 10: mongo-c-driver-devel 2.5.6-1.el10_3 Β· Apache-2.0 AND ISC AND MIT AND Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms