summaryrefslogtreecommitdiffstats
path: root/modules/log.bash
diff options
context:
space:
mode:
Diffstat (limited to 'modules/log.bash')
-rw-r--r--modules/log.bash10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/log.bash b/modules/log.bash
index e9fc665..cd4e038 100644
--- a/modules/log.bash
+++ b/modules/log.bash
@@ -16,12 +16,12 @@ fi
if [[ -n ${LOG_IRC:-} ]]; then
if [[ ${LOG_SHOW_IRC:-0} -ne 0 ]]; then
- exec 14> >(tee -a -- "$LOG_IRC")
+ exec {log_fd}> >(tee -a -- "$LOG_IRC")
else
- exec 14>>"$LOG_IRC"
+ exec {log_fd}>>"$LOG_IRC"
fi
elif [[ ${LOG_SHOW_IRC:-0} -ne 0 ]]; then
- exec 14>&1
+ exec {log_fd}>&1
fi
if [[ -n ${LOG_ERR:-} ]]; then
@@ -31,12 +31,12 @@ fi
# log received messages
on_readmsg() { # args: $1 - raw message, $2 - source, $3 - command, $4... - args
- printf "%s <<< %s\n" "$(log_timestamp)" "$1" >&14
+ printf "%s <<< %s\n" "$(log_timestamp)" "$1" >&$log_fd
}
# log sent messages
on_sendmsg() { # args: $1 - raw message, $2 - command, $3... - args
- printf "%s >>> %s\n" "$(log_timestamp)" "$1" >&14
+ printf "%s >>> %s\n" "$(log_timestamp)" "$1" >&$log_fd
}
log_timestamp() {