From: Chris Koeritz Date: Sat, 19 May 2018 21:36:29 +0000 (-0400) Subject: implemented feisty meow events log file X-Git-Tag: 2.140.112^2~21 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=5ecf1737e802eedda15d7c1eb64732a7f0aa7339 implemented feisty meow events log file logging to a variable FEISTY_MEOW_EVENT_LOG, supported by a method called log_feisty_meow_event, this fascinating new feature provides an event log we could have handily implemented 20 years ago. but it's still useful and needed now. also pushed the fred stats down deeper into personal fred territory in the cloud. --- diff --git a/scripts/agenda/info_overload_report.sh b/scripts/agenda/info_overload_report.sh index a61f34f3..0616d0f4 100644 --- a/scripts/agenda/info_overload_report.sh +++ b/scripts/agenda/info_overload_report.sh @@ -1,7 +1,8 @@ # these metrics are how bogged down we are in to-do type items. -REPORT_FILE="$HOME/cloud/fred_stats/overload_history.txt" +# logged historical file where we append our latest report. +REPORT_FILE="$HOME/cloud/magic_cabinet/fred/task_stats/overload_history.txt" # given a path, this will find how many items are under it, ignoring svn and git files, plus # other patterns we happen to notice are not useful. diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index fc5ce4eb..b1c6096d 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -144,7 +144,7 @@ if [ -z "$skip_all" ]; then function exit_on_error() { if [ $? -ne 0 ]; then - echo -e "\n\naction failed: $*\n\n*** Exiting script..." + echo -e "\n\nan important action failed and this script will stop:\n\n$*\n\n*** Exiting script..." error_sound exit 1 fi @@ -154,13 +154,21 @@ if [ -z "$skip_all" ]; then function continue_on_error() { if [ $? -ne 0 ]; then - echo -e "\n\nerror occurred: $*\n\n=> Continuing script..." + echo -e "\n\na problem occurred, but we can continue:\n\n$*\n\n=> Continuing script..." error_sound fi } ############## + # accepts any number of arguments and outputs them to the feisty meow event log. + function log_feisty_meow_event() + { + echo -e "$(date_stringer) -- $(basename $0):\t\t$*" >> "$FEISTY_MEOW_EVENT_LOG" + } + + ############## + # wraps secure shell with some parameters we like, most importantly to enable X forwarding. function ssh() { diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index 8eca55eb..f2a0f401 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -110,6 +110,11 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org define_yeti_variable TMP=$HOME/.tmp fi + # set up our event logging file for any notable situation to be recorded in. + if [ -z "$FEISTY_MEOW_EVENT_LOG" ]; then + define_yeti_variable FEISTY_MEOW_EVENT_LOG="$TMP/zz_feisty_meow_events.log" + fi + # set up the top-level for all build creations and logs and such. if [ -z "$FEISTY_MEOW_GENERATED_STORE" ]; then define_yeti_variable FEISTY_MEOW_GENERATED_STORE="$TMP/generated-feisty_meow"