mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-13 04:36:57 +00:00
Big Commit
The changes affects multiple places in the repo and this one of the rare instances where I cant be bothered writing a comprehensive commit. Look at the diff for changes. Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
4dd8506346
commit
6bdfd6fcea
10 changed files with 669 additions and 25 deletions
28
scripts/log.sh
Normal file
28
scripts/log.sh
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!bin/bash
|
||||
|
||||
# Error handling function
|
||||
error_handler() {
|
||||
local exit_code=$?
|
||||
local line_number=$1
|
||||
log_critical "Script exited with code $exit_code at line $line_number"
|
||||
log_critical "ABORT: Submodule setup failed - SYSTEM IN UNSTABLE STATE"
|
||||
cleanup_on_failure
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
trap 'error_handler $LINENO' ERR
|
||||
|
||||
# Logging system
|
||||
log() {
|
||||
local level=$1
|
||||
shift
|
||||
local message="$*"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [$level] $message"
|
||||
}
|
||||
|
||||
log_info() { log "INFO" "$*"; }
|
||||
log_warn() { log "WARN" "$*"; }
|
||||
log_error() { log "ERROR" "$*"; }
|
||||
log_critical() { log "CRITICAL" "$*"; }
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue