forked from toolshed/abra
refactor: use central logger
This commit is contained in:
@ -6,12 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/filters"
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"github.com/docker/docker/client"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// GetService retrieves a service container based on a label. If prompt is true
|
||||
@ -52,7 +52,7 @@ func GetServiceByLabel(c context.Context, cl *client.Client, label string, promp
|
||||
return swarm.Service{}, err
|
||||
}
|
||||
|
||||
logrus.Warnf("ambiguous service list received, prompting for input")
|
||||
log.Warnf("ambiguous service list received, prompting for input")
|
||||
|
||||
var response string
|
||||
prompt := &survey.Select{
|
||||
@ -72,7 +72,7 @@ func GetServiceByLabel(c context.Context, cl *client.Client, label string, promp
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Panic("failed to match chosen service")
|
||||
log.Fatal("failed to match chosen service")
|
||||
}
|
||||
|
||||
return matchingServices[0], nil
|
||||
@ -106,7 +106,7 @@ func GetService(c context.Context, cl *client.Client, filters filters.Args, prom
|
||||
return swarm.Service{}, err
|
||||
}
|
||||
|
||||
logrus.Warnf("ambiguous service list received, prompting for input")
|
||||
log.Warnf("ambiguous service list received, prompting for input")
|
||||
|
||||
var response string
|
||||
prompt := &survey.Select{
|
||||
@ -126,7 +126,7 @@ func GetService(c context.Context, cl *client.Client, filters filters.Args, prom
|
||||
}
|
||||
}
|
||||
|
||||
logrus.Panic("failed to match chosen service")
|
||||
log.Fatal("failed to match chosen service")
|
||||
}
|
||||
|
||||
return services[0], nil
|
||||
|
Reference in New Issue
Block a user