SET_AUMESSAGE_MODE(3)

πŸ’– set_aumessage_mode(3) β€” like, the message mode setter πŸ’–

okay bestie, welcome to the Linux Programmer's Manual entry for set_aumessage_mode, and no cap, this one is short and sweet and honestly kind of a slay.


🌸 NAME 🌸

set_aumessage_mode β€” Sets the message mode ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <libaudit.h>

void set_aumessage_mode(message_t mode, debug_message_t debug);

like, that's it. two args, no return value, we love a low-maintenance function 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so set_aumessage_mode sets where messages are sent and also controls the output of the debug messages. it's giving traffic controller but for logs πŸ’…

So here's the vibe check on mode:

  • If mode=MSG_STDERR, then messages are sent to stderr. like right in your face, in the terminal 😭
  • If mode=MSG_SYSLOG, then messages are sent to syslog. the classy route, the main character route πŸ‘‘
  • If mode=MSG_QUIET (default), then messages are not sent. silence. peace. nothing. not a single crumb πŸ™ˆ

And now for the debug parameter, bestie:

  • If debug=DBG_YES, then debug messages are output. full yapping mode enabled πŸ”₯
  • If debug=DBG_NO (default), then debug messages are not output. quiet little angel behavior 🧚
ngl, the defaults here are MSG_QUIET and DBG_NO, so if you don't touch anything, this function is literally just sitting there minding its own business. you have to ask for the noise, fr fr.

⭐ EXAMPLE ⭐

here's the sample code, straight from the source, character for character:

/* Sample code */
set_aumessage_mode(MSG_SYSLOG, DBG_YES)

look at her. sending messages to syslog AND turning debug output on. iconic. ate. periodt πŸ’œ


🌈 RETURN VALUE 🌈

None. πŸ’€

like genuinely, nothing comes back. it's a void function, she gives and she does not receive. respect.


πŸ‘‘ SEE ALSO πŸ‘‘

go read those too, iykyk πŸ“šβœ¨


πŸ’œ AUTHOR πŸ’œ

Debora Velarde. queen behavior, we stan πŸŽ€


and that's the whole page, bestie!! this one came from the Linux 2.6 era, dated 2004-12-01, so she's an old soul but she still slays πŸ’…βœ¨ hope this helped, mwah!! πŸŒΈπŸ¦‹πŸ’–