From 59144bfd58bad11b8a51d5d5ff24da3727d415c5 Mon Sep 17 00:00:00 2001 From: Drew Short Date: Sun, 10 May 2020 18:20:57 -0500 Subject: [PATCH] Clarify logging --- bin/out | 8 ++++---- tag | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/out b/bin/out index b0a8e3b..b2a92bb 100755 --- a/bin/out +++ b/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)_" diff --git a/tag b/tag index ee90284..90a27f9 100644 --- a/tag +++ b/tag @@ -1 +1 @@ -1.0.4 +1.0.5