mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-06-01 21:50:05 +08:00
feat(config): add log level configuration and update logging initialization, close #202
This commit is contained in:
@@ -17,6 +17,7 @@ func RegisterFlags(cmd *cobra.Command) {
|
||||
flags.Bool("stream", false, "enable stream mode")
|
||||
flags.Bool("no-clean-cache", false, "do not clean cache on exit")
|
||||
flags.String("proxy", "", "proxy URL (http, https, socks5, socks5h)")
|
||||
flags.String("log-level", "", "log level (trace/debug, info, warn, error, fatal)")
|
||||
|
||||
// Telegram 配置
|
||||
flags.String("telegram-token", "", "telegram bot token")
|
||||
@@ -54,6 +55,7 @@ func bindFlags(cmd *cobra.Command) {
|
||||
viper.BindPFlag("stream", flags.Lookup("stream"))
|
||||
viper.BindPFlag("no_clean_cache", flags.Lookup("no-clean-cache"))
|
||||
viper.BindPFlag("proxy", flags.Lookup("proxy"))
|
||||
viper.BindPFlag("log.level", flags.Lookup("log-level"))
|
||||
|
||||
// Telegram
|
||||
viper.BindPFlag("telegram.token", flags.Lookup("telegram-token"))
|
||||
|
||||
Reference in New Issue
Block a user