ctdb-scripts: Support script logging to stderr
authorMartin Schwenke <mschwenke@ddn.com>
Sun, 16 Jul 2023 10:52:54 +0000 (20:52 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 19 Jul 2023 09:01:33 +0000 (09:01 +0000)
Logging in statd-callout tests is currently useless.  This will
provide a way of seeing errors in those tests.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/functions

index 7dcd270835793d696ddee5e9766b165c02810714..56105aab1655b3b75482a901ff74def1c84cec6f 100755 (executable)
@@ -95,6 +95,13 @@ script_log()
        shift
 
        case "$CTDB_LOGGING" in
+       file:)
+               if [ -n "$*" ] ; then
+                       echo "$*"
+               else
+                       cat
+               fi >&2
+               ;;
        file:* | "")
                if [ -n "$CTDB_LOGGING" ]; then
                        _file="${CTDB_LOGGING#file:}"