Move logging setup to LoadSettings()
This commit is contained in:
parent
0a817eff87
commit
e7cfcd8688
4
main.go
4
main.go
@ -28,10 +28,6 @@ func setupSettings() error {
|
||||
return fmt.Errorf("Missing stream key is settings.json")
|
||||
}
|
||||
|
||||
if err = settings.SetupLogging(); err != nil {
|
||||
return fmt.Errorf("Unable to setup logger: %s", err)
|
||||
}
|
||||
|
||||
// Save admin password to file
|
||||
if err = settings.Save(); err != nil {
|
||||
return fmt.Errorf("Unable to save settings: %s", err)
|
||||
|
@ -56,6 +56,10 @@ func LoadSettings(filename string) (*Settings, error) {
|
||||
}
|
||||
s.filename = filename
|
||||
|
||||
if err = common.SetupLogging(s.LogLevel, s.LogFile); err != nil {
|
||||
return nil, fmt.Errorf("Unable to setup logger: %s", err)
|
||||
}
|
||||
|
||||
// have a default of 200
|
||||
if s.MaxMessageCount == 0 {
|
||||
s.MaxMessageCount = 300
|
||||
@ -168,7 +172,3 @@ func (s *Settings) GetStreamKey() string {
|
||||
}
|
||||
return s.StreamKey
|
||||
}
|
||||
|
||||
func (s *Settings) SetupLogging() error {
|
||||
return common.SetupLogging(s.LogLevel, s.LogFile)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user