MM_LOG_FATAL(3)
π MM_LOG_FATAL(3) β mmlib library manual π
okay bestie, gather round, because this is the log-level page and it's lowkey iconic. we're in the mmlib library manual and these five functions are literally your group chat of severity levels. let's get into it β¨
β¨ NAME β¨
mm_log_fatal, mm_log_error, mm_log_warn, mm_log_info, mm_log_debug β add a formatted message to the log file π«Ά
that's it, that's the job. five besties, five vibes, one log file. no cap.
πΈ SYNOPSIS πΈ
so first, you gotta pull in the header like it's the aux cord:
#include <mmlog.h>
then, the five icons themselves, all serving the exact same signature energy:
void mm_log_fatal(msg, ...);
void mm_log_error(msg, ...);
void mm_log_warn(msg, ...);
void mm_log_info(msg, ...);
void mm_log_debug(msg, ...);
and don't forget to link her up, or she will simply not show up to the party:
Link with -lmmlib
π¦ DESCRIPTION π¦
okay so here's the tea π β those macros write a log entry (they do it by way of mm_log(3), she's the real one doing the work) and they use the level that matches whatever the macro name says. fatal is fatal, warn is warn, you get it, you're smart, i believe in you π
and here's the lil glow-up: if the preprocessor definition MM_LOG_MAXLEVEL is smaller than the level that corresponds to the macro, then that macro is simply not expanded in the code. poof. gone. it doesn't exist in your binary. the compiler doesn't even look at it. it's giving ghosted π»
now, the module name that shows up inside the location string? that's set by MM_LOG_MODULE_NAME. but if you didn't set it when you included mmlog.h, it auto-initializes itself to the value of PACKAGE_NAME. cute, right? it just knows. β¨
and if MM_LOG_VERBOSE_LOCATION is defined, then the filename and the line number get prepended to that location string. so now your logs are like "yes i know exactly which line did this" and honestly? main character energy π
π RETURN VALUE π
None.
nothing. nada. zero. void. it's a void function, bestie, she returns nothing and she's at peace with that π§ββοΈ
π₯ THREAD SAFETY π₯
mm_log() is thread-safe. π«Ά
not the macros specifically, but the mm_log(3) underneath them β that's the one holding it down. so go ahead and log from all your threads, she can handle it π
π EXAMPLE π
bestie... there is no example. the page is just blank here. not me getting all excited for a demo and there's literally nothing π consider this section a vibe check that we... did not pass. no example for us today π
and that's the whole page, babe! this lil masterpiece comes to you from the mmlib library manual, dated 2012, and it's filed under MM_LOG_FATAL(3). slay, mmlib, honestly ππβ¨
π¦ where this page comes from
- debian trixie: libmmlib-dev 1.4.2-2.1+b1 Β· Apache-2.0
- ubuntu noble: libmmlib-dev 1.4.2-2.1build1 Β· Apache-2.0
- ubuntu questing: libmmlib-dev 1.4.2-2.1build1
- ubuntu resolute: libmmlib-dev 1.4.2-2.1build2 Β· Apache-2.0
- ubuntu stonking: libmmlib-dev 1.4.2-2.1build2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms