MONGOC_STRUCTU...TS_SET_HANDLER(3)
π«Ά MONGOC_STRUCTU...TS_SET_HANDLER(3) π«Ά
okay bestie, this page is from the libmongoc manual and it's all about installing your very own structured-log handler. no cap, it's giving "plug in your callback and let it cook" energy. β¨
β¨ SYNOPSIS β¨
void
mongoc_structured_log_opts_set_handler (mongoc_structured_log_opts_t *opts,
mongoc_structured_log_func_t log_func,
void *user_data);
okay so this function sets the function to be called to handle structured log messages, as a mongoc_structured_log_func_t. that's the whole vibe. π
the callback gets a mongoc_structured_log_entry_t as a handle for obtaining additional information about the log message. important: this entry pointer is only valid during a callback, because it's a low cost reference to temporary data. do not be out here storing it, bestie. π
structured log handlers must be thread-safe if they will be used with mongoc_client_pool_t. also, handlers must avoid unbounded recursion, preferably by avoiding the use of any libmongoc client or pool which uses the same handler. yes, that's the warning label. π«Ά
this function always replaces the default log handler from mongoc_structured_log_opts_new(), if it was still set. and if log_func is set to NULL, structured logging will be disabled. periodt. π
π PARAMETERS π
optsβ Structured log options, allocated withmongoc_structured_log_opts_new().log_funcβ The handler to install, amongoc_structured_log_func_t, orNULLto disable structured logging.user_dataβ Optional user data, passed on to the handler.
π¦ SEE ALSO π¦
Structured Logging
π AUTHOR π
MongoDB, Inc
π COPYRIGHT π
2009-present, MongoDB, Inc.
bye bestie π this footer is giving version 2.5.6, dated Oct 09, 202 β xoxo, the manual page π
π¦ 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