feat: add log level setting

This commit is contained in:
Simon Ding
2024-07-26 14:22:08 +08:00
parent f5f8434832
commit 1dd61ccbca
6 changed files with 52 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ const (
SettingJacketUrl = "jacket_url"
SettingJacketApiKey = "jacket_api_key"
SettingDownloadDir = "download_dir"
SettingLogLevel = "log_level"
)
const (

View File

@@ -57,6 +57,11 @@ func (c *Client) init() {
log.Infof("set default download dir")
c.SetSetting(downloadDir, "/downloads")
}
logLevel := c.GetSetting(SettingLogLevel)
if logLevel == "" {
log.Infof("set default log level")
c.SetSetting(SettingLogLevel, "info")
}
}
func (c *Client) generateJwtSerectIfNotExist() {