rtapi_set_msg_level(3rtapi)

πŸ“¦
version 2.9.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

rtapi_get_msg_level, rtapi_set_msg_level β€” bestie, this is how you get or set the logging level πŸŽ€

It's living in the RTAPI manual section (that's the 3rtapi vibe, iykyk) ✨


🌸 SYNTAX 🌸

int rtapi_set_msg_level(int level)

int rtapi_get_msg_level()

Two little functions, one big glow-up for your logs. πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • level β€” the logging level you're manifesting ✨ like, the one you desire 🫢

πŸ’œ DESCRIPTION πŸ’œ

Okay so, this pair gets or sets the RTAPI message level that rtapi_print_msg uses. That's the whole job. 🌈

And here's the tea πŸ“: depending on the RTOS, that level might apply to just one single RTAPI module, or it might apply to a whole group of modules. So no cap β€” scope is RTOS-dependent, and that's just how it is, bestie 😭


πŸ‘‘ REALTIME CONSIDERATIONS πŸ‘‘

The vibe check here is very permissive, periodt:

  • may be called from non-realtime code βœ…
  • may be called from init/cleanup code βœ…
  • may be called from realtime code βœ…

All three. Iconic. 🧚


⭐ RETURN VALUE ⭐

  • rtapi_set_msg_level returns a status code πŸ’«
  • rtapi_get_msg_level returns the current level πŸ‘‘

And here's the level ladder, memorize it fr fr:

  • RTAPI_MSG_NONE = 0
  • RTAPI_MSG_ERR = 1
  • RTAPI_MSG_WARN = 2
  • RTAPI_MSG_INFO = 3
  • RTAPI_MSG_DBG = 4
  • RTAPI_MSG_ALL = 5

Zero to five, quiet to loud, the whole spectrum bestie 🌈

Not me putting the numbers in a bullet list because there's literally no table allowed πŸ™ˆ but every single one is there, don't worry 🫢

🌟 SEE ALSO 🌟

  • rtapi_print_msg(3rtapi) β€” the function that actually uses this level, go read it next πŸ”₯

Mwah πŸ’– that's the whole page! Written up by the LinuxCNC Documentation girlies, dated 2006-10-12, and yeah she's been serving since then πŸ‘‘βœ¨