20 lines
287 B
Bash
20 lines
287 B
Bash
#!/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"
|
|
}
|