EC_LOG_DEFAULT_CB(3)

πŸ’– EC_LOG_DEFAULT_CB πŸ’–

okay so bestie, this one lives in the libecoli programmer's manual, section 3, and it's literally the default log handler. like, the one that's already doing the most before you even touch anything. let's get into it 🫢


✨ NAME ✨

ec_log_default_cb β€” the Default log handler. she's the blueprint, the OG, the main character of logging πŸ’…


✨ SYNOPSIS ✨

#include <ecoli/log.h>

int ec_log_default_cb(
    int                type,    /* The log type identifier. */
    enum ec_log_level  level,   /* The log level. */
    void              *opaque,  /* Unused. */
    const char        *str      /* The string to be logged. */
);

okay so like, four args, one int coming back at ya. noted. πŸ“


✨ DESCRIPTION ✨

This is the default log function that the library uses. like, out of the box, no setup, no nothing. πŸŽ€

By default it prints all the logs whose level is WARNING or more critical. so the spicy ones. the ones that actually matter. πŸ”₯

And if you wanna change that level? totally doable β€” just hit up ec_log_level_set(). you're welcome. πŸ’œ


✨ STRUCTURES ✨

here's the level enum, in all her glory. it goes from "we are so cooked" all the way down to "just chatting":

enum ec_log_level {
      EC_LOG_EMERG;
      EC_LOG_ALERT;
      EC_LOG_CRIT;
      EC_LOG_ERR;
      EC_LOG_WARNING;
      EC_LOG_NOTICE;
      EC_LOG_INFO;
      EC_LOG_DEBUG;
};

EC_LOG_EMERG is at the top and EC_LOG_DEBUG is at the bottom, and that ordering is literally the whole vibe check of the thing. ✨


✨ RETURN VALUE ✨

  • 0 on success πŸŽ‰
  • -1 on error, and errno gets set 😭 (as is tradition)

✨ SEE ALSO ✨

go be nosy, bestie, they're all right here:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.


and that's the whole page, bestie!! πŸ¦‹ this one's from libecoli, dated 2026-06-11, and it's EC_LOG_DEFAULT_CB(3) in case you lost the plot. go forth and log responsibly πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from