Reference

set severity-output

Change the severity level format.

Description Jump to heading

When a Runtime API command returns an error or warning, that message has a numeric severity level, which comes from the RFC5424 Syslog severity levels. The RFC specification describes the levels as follows:

Code Severity
0 Emergency: system is unusable
1 Alert: action must be taken immediately
2 Critical: critical conditions
3 Error: error conditions
4 Warning: warning conditions
5 Notice: normal but significant condition
6 Informational: informational messages
7 Debug: debug-level messages

Call set severity-output with a value of number to show the code only. Call it with string to show the severity level name. By default, it is set to none, which shows neither the code nor the severity level name.

Examples Jump to heading

Below, we show three different formats for the same error message. We change the severity output format with the set severity-output command. Then in the same session, we call get acl without one of its required parameters to artificially prompt an error message.

Call set severity-output none to hide the severity level:

nix
echo "set severity-output none; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "set severity-output none; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
Missing ACL identifier and/or key.
output
text
Missing ACL identifier and/or key.

Call set severity-output number to show the severity level number:

nix
echo "set severity-output number; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "set severity-output number; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
[3]: Missing ACL identifier and/or key.
output
text
[3]: Missing ACL identifier and/or key.

Call set severity-output string to show the severity level name:

nix
echo "set severity-output string; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "set severity-output string; get acl #0" | \
sudo socat stdio tcp4-connect:127.0.0.1:9999
output
text
[err]: Missing ACL identifier and/or key.
output
text
[err]: Missing ACL identifier and/or key.

See also Jump to heading

Do you have any suggestions on how we can improve the content of this page?