From fc58f12174e8f27884d54b2e1ed8ae7ab1915d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quentin=20Guid=C3=A9e?= Date: Mon, 18 Sep 2023 00:34:44 -0400 Subject: [PATCH] Improve reading service debug with the service ID --- types/service.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/types/service.go b/types/service.go index 53c2d4d5..daf7526b 100644 --- a/types/service.go +++ b/types/service.go @@ -62,16 +62,23 @@ type Service struct { type ServiceV1 Service func (s *Service) UnmarshalYAML(unmarshal func(interface{}) error) error { - var versioning ServiceVersioning - err := unmarshal(&versioning) + var service struct { + ServiceVersioning `yaml:",inline"` + ID string `yaml:"id"` + } + + err := unmarshal(&service) if err != nil { return err } - s.ServiceVersioning = versioning + s.ServiceVersioning = service.ServiceVersioning - log.Debug("reading service", vlog.Int("version", int(versioning.Version))) + log.Debug("reading service", + vlog.Int("version", int(service.Version)), + vlog.String("id", service.ID), + ) - switch versioning.Version { + switch service.Version { case 0, 1: var service ServiceV1 err := unmarshal(&service)