Browse Source

Clarify logging

master
Drew Short 4 years ago
parent
commit
59144bfd58
  1. 8
      bin/out
  2. 2
      tag

8
bin/out

@ -3,9 +3,9 @@
# Send message to a matrix room. API call looks like this:
# curl -XPOST -d '{"msgtype":"m.text", "body":"hello"}' "http://matrix.org/_matrix/client/api/v1/rooms/%21CvcvRuDYDzTOzfKKgh%3Alocalhost/send/m.room.message?access_token=YOUR_ACCESS_TOKEN"
log ()
log_debug ()
{
if [[ $1 == "debug" ]]; then
if [[ $1 == "true" ]]; then
echo "DEBUG: $2"
fi
}
@ -48,14 +48,14 @@ thismsgtype="$(jq -r '.params.msgtype // ""' < "${payload}")"
[[ -n $thismsgtype && $thismsgtype != $msgtype ]] && msgtype="${thismsgtype}"
always_notify="$(jq -r '.params.always_notify // "false"' < "${payload}")"
debug="$(jq -r '.params.debug // ""' < "${payload}")"
debug="$(jq -r '.params.debug // "false"' < "${payload}")"
silent="$(jq -r '.params.silent // "true"' < "${payload}")"
link="$(jq -r '.params.link // "false"' < "${payload}")"
team="$(jq -r '.params.team // "main"' < "${payload}")"
prefix="$(jq -r '.params.prefix // ""' < "${payload}")"
is_html="$(jq -r '.params.is_html // "false"' < "${payload}")"
log("$debug", "$(jq '.' < "${payload}")")
log_debug("$debug" "$(jq '.' < "${payload}")")
TEXT_FILE_CONTENT=""
[[ -n "${text_file}" && ! -f "${text_file}" ]] && TEXT_FILE_CONTENT="_(text_file not found)_"

2
tag

@ -1 +1 @@
1.0.4
1.0.5
Loading…
Cancel
Save