mirror of
https://github.com/YuleBest/LuminPro.git
synced 2026-12-04 00:54:42 +08:00
feat(log): 日志等级
This commit is contained in:
1 parent
ae42b7f0f2
commit
66ff3a6429
9 files changed
+74
-7
No files matched your search
@@ -36,6 +36,13 @@ get_config_hash() {
|
||||
|
||||
_log() {
|
||||
local level="${2:-INFO}"
|
||||
local ll
|
||||
ll="$(get_cfg log_level "info")"
|
||||
case "$ll" in
|
||||
off) return ;;
|
||||
error) case "$level" in ERROR) ;; *) return ;; esac ;;
|
||||
warn) case "$level" in ERROR | WARN) ;; *) return ;; esac ;;
|
||||
esac
|
||||
printf '[%s] [%s] [%s] %s\n' "$(date '+%m-%d %H:%M:%S')" "daemon" "$level" "$1" >>"$log_file"
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user