diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-12-28 15:59:04 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-12-28 15:59:04 +0200 |
commit | 89d00fcbc75e128cba516009db100daec4b794a9 (patch) | |
tree | 9e98d87d9fef51a06d830ef2dd659cdc6fed2fb4 /lib/_ak_log | |
parent | 756db3cbdb91d2cb4773dd16aec3b54d1a52c462 (diff) | |
download | arching-kaos-tools-89d00fcbc75e128cba516009db100daec4b794a9.tar.gz arching-kaos-tools-89d00fcbc75e128cba516009db100daec4b794a9.tar.bz2 arching-kaos-tools-89d00fcbc75e128cba516009db100daec4b794a9.zip |
refactoringHEADorigin/masterorigin/HEADmaster
Diffstat (limited to 'lib/_ak_log')
-rwxr-xr-x | lib/_ak_log | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/_ak_log b/lib/_ak_log index f6ffc21..8d6972d 100755 --- a/lib/_ak_log +++ b/lib/_ak_log @@ -18,7 +18,7 @@ ### along with this program. If not, see <http://www.gnu.org/licenses/>. ### -_ak_log_print_log_line(){ +function _ak_log_print_log_line(){ if [ -n "$1" ] then timestamp="$(echo "$*" | awk '{print $1}')" @@ -33,14 +33,14 @@ _ak_log_print_log_line(){ fi } -_ak_log_follow(){ +function _ak_log_follow(){ tail -f $AK_LOGSFILE | while read -r p || [ -n "$p" ] do _ak_log_print_log_line "$p" done } -_ak_log_grep(){ +function _ak_log_grep(){ if [ ! -z $1 ] && [ -n "$1" ] then if [ "$1" == "-h" ] || [ "$1" == "--help" ] @@ -50,7 +50,6 @@ _ak_log_grep(){ exit 1 fi fi - echo "The following scripts have entries in the log file." echo "Select one of those by entering the number of it below and hit enter:" select x in $(cat $AK_LOGSFILE | cut -d ' ' -f 2 | sort | uniq) @@ -63,7 +62,7 @@ _ak_log_grep(){ done } -_ak_log_rotate(){ +function _ak_log_rotate(){ if [ -f $AK_LOGSFILE ] then tar cvfz $AK_ARCHIVESDIR/logs_$(date -u +%s).tar.gz $AK_WORKDIR/logs @@ -76,7 +75,7 @@ _ak_log_rotate(){ fi } -_ak_log_message(){ +function _ak_log_message(){ TS="$(date -u +%s)" if [ ! -z $1 ] && [ -n "$1" ] then @@ -116,23 +115,23 @@ _ak_log_message(){ fi } -_ak_log_exit(){ +function _ak_log_exit(){ _ak_log_message "$PROGRAM" "EXIT" "$1" } -_ak_log_warning(){ +function _ak_log_warning(){ _ak_log_message "$PROGRAM" "WARNING" "$1" } -_ak_log_debug(){ +function _ak_log_debug(){ _ak_log_message "$PROGRAM" "DEBUG" "$1" } -_ak_log_error(){ +function _ak_log_error(){ _ak_log_message "$PROGRAM" "ERROR" "$1" } -_ak_log_info(){ +function _ak_log_info(){ _ak_log_message "$PROGRAM" "INFO" "$1" } |