EC_LOG(3)

EC_LOG(3) β€” bestie, we're logging πŸ’–

okay so this is from the Libecoli Programmer's Manual, section 3 (library calls, iykyk), and it's literally just… the log function. the one you call when you want to say something into the void and have the void write it down with a timestamp-ish vibe. it's giving ✨ ec_log ✨ β€” "Log a formatted string." that's the whole NAME section, that's it, that's the tea πŸ«–


🌸 NAME 🌸

ec_log β€” log a formatted string, bestie. that's it. that's the function. πŸ’…


✨ SYNOPSIS ✨

first things first, you gotta pull in the header or nothing happens, no cap:

#include <ecoli/log.h>

then the function itself, in all its glory β€” every comment included because I am not gatekeeping:

int ec_log(
    int                type,    /* The log type identifier. */
    enum ec_log_level  level,   /* The log level. */
    /*
     * The format string, followed by optional arguments.
     */
    const char        *format,
    ...
);

so like. you hand it a type (the log type identifier 🏷️), you hand it a level (the log level, from that enum below, stay tuned), and then you hand it a format string β€” and after that format string, the optional arguments. yes queen, it's a variadic. it's printf-coded. πŸŽ€


πŸ¦‹ STRUCTURES πŸ¦‹

here's the whole level menu, from "the world is ending" 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;
};

eight levels, all present, all accounted for, nothing skipped, periodt. πŸ’–


πŸ‘‘ RETURN VALUE πŸ‘‘

  • 0 on success β€” slay, it worked 🌈
  • -1 on error, and when that happens, errno is set. so go check errno, bestie, it's telling you what went wrong 😭

πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, go read these too, they're all iconic:


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

and that's the page!! πŸ’œ this whole thing lives in the libecoli manual, dated 2026-06-11, and if you ever forget it, just yell man 3 EC_LOG and it'll come running. mwah, bye bestie 🧚✨🫢

πŸ“¦ where this page comes from