feat(logging): first very simple logging implementation

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-04-01 23:44:50 +02:00
parent 9e40d15e8a
commit 4ad318555e
2 changed files with 15 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ set -e
### base variables
SYSTEMD="/etc/systemd/system"
LOGFILE="/tmp/kiauh.log"
# setting up some frequently used functions
check_euid(){
@@ -27,6 +28,15 @@ check_euid(){
fi
}
function timestamp() {
date +"[%F %T]"
}
function log() {
local message="${1}"
echo -e "$(timestamp) ${message}" | tr -s " " >> "${LOGFILE}"
}
check_klipper_cfg_path(){
source_kiauh_ini
if [ -z "${klipper_cfg_loc}" ]; then