EC_LOG_TYPE_REGISTER(3)

✨ EC_LOG_TYPE_REGISTER ✨

okay bestie, welcome to the Libecoli Programmer's Manual πŸ’– you're literally about to learn how to register a log type and honestly? it's giving main character energy. no cap.


🌸 NAME 🌸

ec_log_type_register β€” register a named log type. that's it, that's the whole job. iconic. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <ecoli/log.h>

int ec_log_type_register(
    struct ec_log_type   *type   /* The log type to register. */
);

πŸ’œ DESCRIPTION πŸ’œ

so basically, bestie: this registers a new log type, and that log type gets identified by its name. πŸŽ€

the function hands you back a log identifier associated with the log name. and here's the cute part β€” if the name is already registered, it doesn't get mad, it doesn't duplicate anything, it just quietly returns the identifier you already have. lowkey so polite of it. 🫢


🧚 STRUCTURES 🧚

a structure describing a log type, fr fr.

it is defined as a static structure</> by the EC_LOG_TYPE_REGISTER() macro. πŸ‘‘

struct ec_log_type {
    enum   level;
    int    id;
};

🌈 RETURN VALUE 🌈

  • the log type identifier on success β€” and yes that's positive or zero, both count πŸ’š
  • -1 on error, and errno is set (so go check it, bestie, don't just sit there 😭)

πŸ”₯ SEE ALSO πŸ”₯


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


and that's the whole page, periodt. πŸ’…βœ¨ this lil slice of the libecoli Programmer's Manual was served fresh on 2026-06-11 β€” go forth and register those log types, bestie, you ate. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from