first
This commit is contained in:
19
lib/log.sh
Normal file
19
lib/log.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
log_init() {
|
||||
: > "$RUNTIME_LOG_FILE"
|
||||
}
|
||||
|
||||
log_write() {
|
||||
local level="$1"
|
||||
local message="$2"
|
||||
printf '%s [%s] %s\n' "$(date '+%F %T')" "$level" "$message" >> "$RUNTIME_LOG_FILE"
|
||||
}
|
||||
|
||||
log_info() {
|
||||
log_write "INFO" "$1"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
log_write "ERROR" "$1"
|
||||
}
|
||||
Reference in New Issue
Block a user