---
name: "rtapi_set_msg_level"
section: "3rtapi"
platform: "linux"
package: "linuxcnc-uspace-dev"
version: "1:2.9.4-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rtapi_set_msg_level"
---

# rtapi\_set\_msg\_level(3rtapi)

Get or set the logging level

## NAME

rtapi\_get\_msg\_level, rtapi\_set\_msg\_level - Get or set the logging level

## SYNTAX

 int rtapi\_set\_msg\_level(int *level*)

 int rtapi\_get\_msg\_level()

## ARGUMENTS

- *level*

  The desired logging level

## DESCRIPTION

Get or set the RTAPI message level used by **rtapi\_print\_msg**.  Depending on the RTOS, this level may apply to a single RTAPI module, or it may apply to a group of modules.

## REALTIME CONSIDERATIONS

May be called from non-realtime, init/cleanup, and realtime code.

## RETURN VALUE

**rtapi\_set\_msg\_level** returns a status code, and **rtapi\_get\_msg\_level** returns the current level. RTAPI\_MSG\_NONE = 0, RTAPI\_MSG\_ERR = 1, RTAPI\_MSG\_WARN = 2, RTAPI\_MSG\_INFO = 3, RTAPI\_MSG\_DBG = 4 RTAPI\_MSG\_ALL = 5

## SEE ALSO

**rtapi\_print\_msg(3rtapi)**
