add debug to init func

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-09-30 00:42:48 +03:00
parent ad6912beef
commit e0cbe28c8f
1 changed files with 5 additions and 2 deletions

View File

@ -68,8 +68,11 @@ func (c *consulConfig) Init(opts ...config.Option) error {
}
cli, err := api.NewClient(cfg)
if err != nil && !c.opts.AllowFail {
return err
if err != nil {
c.opts.Logger.Errorf(c.opts.Context, "consul init err: %v", err)
if !c.opts.AllowFail {
return err
}
}
c.cli = cli