mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
Fix startup order, setting LogLevel
This commit is contained in:
parent
1e582bec5c
commit
28cd3ec3e4
4 changed files with 12 additions and 7 deletions
|
@ -41,7 +41,10 @@ func LoadFromEnv() {
|
|||
Sonic.Port = port
|
||||
}
|
||||
l := &multiconfig.EnvironmentLoader{}
|
||||
l.Load(Sonic)
|
||||
err := l.Load(Sonic)
|
||||
if err != nil {
|
||||
log.Error("Error parsing configuration from environment")
|
||||
}
|
||||
}
|
||||
|
||||
func LoadFromTags() {
|
||||
|
@ -55,7 +58,6 @@ func LoadFromFile(tomlFile string) {
|
|||
if err != nil {
|
||||
log.Error("Error loading configuration file", "file", tomlFile, err)
|
||||
}
|
||||
log.SetLogLevelString(Sonic.LogLevel)
|
||||
}
|
||||
|
||||
func LoadFromLocalFile() {
|
||||
|
@ -68,6 +70,7 @@ func Load() {
|
|||
LoadFromLocalFile()
|
||||
LoadFromEnv()
|
||||
LoadFromFlags()
|
||||
log.SetLogLevelString(Sonic.LogLevel)
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue