DC_CONTEXT_SET_LOGFUNC(3)
π DC_CONTEXT_SET_LOGFUNC β bestie, it's giving "set the logging function" energy
okay so this is a libdivecomputer manpage, page DC_CONTEXT_SET_LOGFUNC(3), and it's literally about plugging your own log function into a dive computer context. sit with me, we're doing this π«Ά
β¨ NAME β¨
dc_context_set_logfunc β set the logging function for a dive computer context. that's it. that's the vibe. π
π LIBRARY π
library βlibdivecomputerβ β yes queen, that one π
πΈ SYNOPSIS πΈ
#include <libdivecomputer/context.h>
typedef void
(*dc_logfunc_t)(dc_context_t *context, dc_loglevel_t loglevel,
const char *file, unsigned int line, const char *function,
const char *message, void *userdata);
dc_status_t
dc_context_set_logfunc(dc_context_t *context, dc_logfunc_t logfunc,
void *userdata);
copy it exactly, bestie, no cap β¨
π DESCRIPTION π
so what we're doing here is setting the logging function logfunc that's associated with a dive computer context. main character behavior honestly π
here's the tea: the logging function gets invoked with the argument userdata when the log level (peep dc_context_set_loglevel(3) if you wanna know more) has been exceeded. iykyk π
the logfunc accepts the following values, and you're gonna wanna know every single one of them, fr fr:
contextβ the context in which it was invoked. literally the context, that's the whole thing π¦loglevelβ the level of the log message. how serious are we talking π₯fileβ the source file where the message was raised. snitching on itself, love that for it πlineβ the source line (from 1) where the message was raised. counting from1, not0, don't @ mefunctionβ the function that raised the log message. names names πmessageβ the log message itself. the actual words π¬userdataβ the pointer passed todc_context_set_logfunc. your little bonus gift, you're welcome π
π«Ά RETURN VALUES π«Ά
- Returns
DC_STATUS_OKon setting the log level β slay β¨ - Returns
DC_STATUS_INVALIDARGSifcontextisNULLβ yeah, that'll happen π - or another error code on failure β it happens to the best of us, no biggie π
π SEE ALSO π
go read them, they're iconic too π
π§ AUTHORS π§
the library βlibdivecomputerβ library was written by Jef Driesen, jef@libdivecomputer.org β king behavior π the manpages were written by Kristaps Dzonsons, kristaps@bsd.lv β also king behavior, we stan πΈ
and that's the whole page, bestie!! π this one came from the Debian crew, dated January 5, 2017, and it's the DC_CONTEXT_SET_LOGFUNC(3) page β periodt. go forth and log responsibly πβ¨π¦
π¦ where this page comes from
- nixos 26.05: libdivecomputer 0.9.0
- nixpkgs unstable: libdivecomputer 0.9.0
- Copyright (C) 2017 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms