From e0cbe28c8f5e4759087b8a0e5d3333d8599258ac Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Thu, 30 Sep 2021 00:42:48 +0300 Subject: [PATCH] add debug to init func Signed-off-by: Vasiliy Tolstov --- consul.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/consul.go b/consul.go index 0146cf7..6fa8a84 100644 --- a/consul.go +++ b/consul.go @@ -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