Skip to content

Commit

Permalink
Improve reading service debug with the service ID
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Sep 18, 2023
1 parent 954bc5c commit fc58f12
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions types/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fc58f12

Please sign in to comment.