mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-07-08 17:32:06 +08:00
feat(config): add log level configuration and update logging initialization, close #202
This commit is contained in:
@@ -23,6 +23,7 @@ type Config struct {
|
||||
Threads int `toml:"threads" mapstructure:"threads" json:"threads"`
|
||||
Stream bool `toml:"stream" mapstructure:"stream" json:"stream"`
|
||||
Proxy string `toml:"proxy" mapstructure:"proxy" json:"proxy"`
|
||||
Log logConfig `toml:"log" mapstructure:"log" json:"log"`
|
||||
Aria2 aria2Config `toml:"aria2" mapstructure:"aria2" json:"aria2"`
|
||||
API apiConfig `toml:"api" mapstructure:"api" json:"api"`
|
||||
|
||||
@@ -100,10 +101,11 @@ func Init(ctx context.Context, configFile ...string) error {
|
||||
|
||||
defaultConfigs := map[string]any{
|
||||
// 基础配置
|
||||
"lang": "zh-Hans",
|
||||
"workers": 3,
|
||||
"retry": 3,
|
||||
"threads": 4,
|
||||
"lang": "zh-Hans",
|
||||
"workers": 3,
|
||||
"retry": 3,
|
||||
"threads": 4,
|
||||
"log.level": "debug",
|
||||
|
||||
// 缓存配置
|
||||
"cache.ttl": 86400,
|
||||
|
||||
Reference in New Issue
Block a user