DC_CONTEXT_SET_LOGLEVEL(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

okay so bestie, this is DC_CONTEXT_SET_LOGLEVEL(3) from the Library Functions Manual, and it's giving very much libdivecomputer energy πŸ’…βœ¨. no cap, we're about to make log levels make sense.

πŸ’– NAME πŸ’–

dc_context_set_loglevel β€” set the logging level for a dive computer context, periodt πŸŽ€

πŸŽ€ LIBRARY πŸŽ€

bestie this one lives in the library libdivecomputer β€” iconic, we know πŸ¦‹

✨ SYNOPSIS ✨

#include <libdivecomputer/context.h>

dc_status_t
dc_context_set_loglevel(dc_context_t *context, dc_loglevel_t loglevel);

🌸 DESCRIPTION 🌸

okay so the whole vibe: this sets the minimum log level required to raise a logging event with the dc_context_set_logfunc(3) callback. It operates on a dive computer context created with dc_context_new(3). lowkey important, highkey useful πŸ’œ

The log levels are ordered like this, and yes, the order is the whole point:

  1. DC_LOGLEVEL_NONE
  2. DC_LOGLEVEL_ERROR
  3. DC_LOGLEVEL_WARNING
  4. DC_LOGLEVEL_INFO
  5. DC_LOGLEVEL_DEBUG
  6. DC_LOGLEVEL_ALL

By setting, for example, DC_LOGLEVEL_INFO, all events of DC_LOGLEVEL_ERROR, DC_LOGLEVEL_WARNING, and DC_LOGLEVEL_INFO will be reported via the callback in dc_context_set_logfunc(3). so yes, you get the errors, warnings, and info events in the group chat 😭πŸ”₯

🫢 RETURN VALUES 🫢

Returns DC_STATUS_OK on setting the log level, DC_STATUS_INVALIDARGS if context is NULL, or another error code on failure. ngl, that NULL check is doing main character work πŸ’€

🌈 SEE ALSO 🌈

πŸ‘‘ AUTHORS πŸ‘‘

The library libdivecomputer was written by Jef Driesen, jef@libdivecomputer.org. The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv. absolute legends, fr fr πŸ«‘πŸ’–

mwah πŸ’‹ that's the whole page, bestie β€” brought to you by Debian on January 5, 2017, and it's DC_CONTEXT_SET_LOGLEVEL(3). byeee 🫢🌈

πŸ“¦ where this page comes from