Annotating Logs
RWX will capture stdout and stderr from the process that it runs. To make it easier for your engineers to read the log output, you may want to annotate the logs.
Log Groups
RWX supports groups of log lines which can be collapsed and expanded in the UI.
To create a group of log lines, write ::group:: at the start of a line.
You can include additional characters as a sort of title for the log group, such as ::group:: a description for the group.
To end the group, write ::endgroup:: at the start of a line.
Here's a full example.
tasks:
- key: test-log-groups
run: |
echo ::group:: this is a log group
for i in {1..10}; do
echo $i
done
echo ::endgroup::
echo this line is after the group
And here's how it looks in the results UI:
Custom messages
You can render important messages outside of your logs for additional emphasis by redirecting output to a file.
Errors
Redirect output to a file in the $RWX_ERRORS directory to produce an error message. For example:
tasks:
- key: boom
run:
- echo "boom" > $RWX_ERRORS/error0
- echo "bang" > $RWX_ERRORS/error1
Warnings
Redirect output to a file in the $RWX_WARNINGS directory to produce a warning message. For example:
tasks:
- key: warn
run:
- echo "look" > $RWX_WARNINGS/warning0
- echo "here" > $RWX_WARNINGS/warning1
Info
Redirect output to a file in the $RWX_INFO directory to produce an info message. For example:
tasks:
- key: info
run:
- echo "important" > $RWX_INFO/info0
- echo "info" > $RWX_INFO/info1
