mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
losing my mind
This commit is contained in:
@@ -71,7 +71,20 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
conf.LoadOSEnv(config.GetEnv(), false)
|
||||
|
||||
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
|
||||
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
|
||||
cfg.Log = &shared.Log{
|
||||
Level: cfg.Commons.Log.Level,
|
||||
Pretty: cfg.Commons.Log.Pretty,
|
||||
Color: cfg.Commons.Log.Color,
|
||||
File: cfg.Commons.Log.File,
|
||||
}
|
||||
} else if cfg.Log == nil && cfg.Commons == nil {
|
||||
cfg.Log = &shared.Log{}
|
||||
}
|
||||
|
||||
conf.LoadOSEnv(config.GetEnv(cfg), false)
|
||||
bindings := config.StructMappings(cfg)
|
||||
return ociscfg.BindEnv(conf, bindings)
|
||||
}
|
||||
@@ -83,9 +96,7 @@ type SutureService struct {
|
||||
|
||||
// NewSutureService creates a new settings.SutureService
|
||||
func NewSutureService(cfg *ociscfg.Config) suture.Service {
|
||||
if (cfg.Settings.Log == shared.Log{}) {
|
||||
cfg.Settings.Log = cfg.Log
|
||||
}
|
||||
cfg.Settings.Commons = cfg.Commons
|
||||
return SutureService{
|
||||
cfg: cfg.Settings,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user