summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-03-21 14:11:54 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-03-21 14:16:43 -0400
commitb5711afc9b9f509d668994511b81cc24f4d352ef (patch)
tree5a4f5ea0b196b8aa07317a4aea4981e67f0a6403
parent8233cd9bf1da9203d3ad5664be3864e4fdaeff55 (diff)
wmii: improve logging
-rw-r--r--.config/wmii-hg/config.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/.config/wmii-hg/config.sh b/.config/wmii-hg/config.sh
index 967d5de..ca32e1a 100644
--- a/.config/wmii-hg/config.sh
+++ b/.config/wmii-hg/config.sh
@@ -12,6 +12,10 @@ mkdir -p -- "${HIST%/*}"
# Colors tuples: "<text> <background> <border>"
. theme-abyss
+log() {
+ echo "wmiirc[$$]: $*"
+}
+
Event() {
local event=$1; shift;
case "$event" in
@@ -30,7 +34,7 @@ Event() {
## Custom (non-WMII-generated) events
WmiircStart) ## No args
- echo ' ==> Starting wmiirc'
+ log " ==> Starting wmiirc[$$]"
is_mounted $WMII_DIR && Event WmiircUnmount
Event WmiircMount
@@ -53,18 +57,18 @@ Event() {
;;
WmiircQuit) ## No args
trap - EXIT
- echo ' ==> Stopping wmiirc'
+ log " ==> Stopping wmiirc[$$]"
exit;;
WmiircMount) ## No args
- echo " -> Creating mountpoint WMII_DIR=$WMII_DIR..."
+ log " -> Creating mountpoint WMII_DIR=$WMII_DIR..."
mkdir -p "$WMII_DIR"
- echo " -> Mounting WMII_DIR=$WMII_DIR..."
+ log " -> Mounting WMII_DIR=$WMII_DIR..."
mount.9p "$WMII_ADDRESS" "$WMII_DIR"
;;
WmiircUnmount) ## No args
- echo " -> Unmounting WMII_DIR=$WMII_DIR..."
+ log " -> Unmounting WMII_DIR=$WMII_DIR..."
umount.9p "$WMII_DIR"
- echo " -> Removing mountpoint WMII_DIR=$WMII_DIR..."
+ log " -> Removing mountpoint WMII_DIR=$WMII_DIR..."
rmdir -p "$WMII_DIR" 2>/dev/null;;
## WMII-meta events
Quit) ## No args