mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-06-07 09:49:41 +08:00
chore: 战略撤退,代码全量回滚至 9a38fb6 (PR 引入前的纯净状态)
This commit is contained in:
@@ -23,14 +23,8 @@ if ! type log >/dev/null 2>&1; then
|
||||
local local_ver="${AGENT_VERSION:-未知}"
|
||||
|
||||
mkdir -p "${INSTALL_DIR}/logs"
|
||||
local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$2" "$1" "$REGION_CODE" "$3")
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log"
|
||||
# 强制推送到 Systemd Journal (如果系统支持)
|
||||
if command -v logger >/dev/null 2>&1; then
|
||||
logger -t ip-sentinel "$core_msg"
|
||||
else
|
||||
echo "$core_msg"
|
||||
fi
|
||||
# 统一日志格式,注入 [版本号] 追踪标识
|
||||
printf "[$(date '+%Y-%m-%d %H:%M:%S')] [v%-5s] [%-5s] [%-7s] [%s] %s\n" "$local_ver" "$2" "$1" "$REGION_CODE" "$3" >> "${INSTALL_DIR}/logs/sentinel.log"
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user