Move RunnerFormatter to ./log package

parent 3b361028
......@@ -10,7 +10,7 @@ import (
"gitlab.com/gitlab-org/gitlab-runner/common"
"gitlab.com/gitlab-org/gitlab-runner/helpers/archives"
"gitlab.com/gitlab-org/gitlab-runner/helpers/formatter"
"gitlab.com/gitlab-org/gitlab-runner/log"
"gitlab.com/gitlab-org/gitlab-runner/network"
)
......@@ -36,7 +36,7 @@ func (c *ArtifactsDownloaderCommand) download(file string) (bool, error) {
}
func (c *ArtifactsDownloaderCommand) Execute(context *cli.Context) {
formatter.SetRunnerFormatter()
log.SetRunnerFormatter()
if len(c.URL) == 0 || len(c.Token) == 0 {
logrus.Fatalln("Missing runner credentials")
......
......@@ -13,7 +13,7 @@ import (
"gitlab.com/gitlab-org/gitlab-runner/common"
"gitlab.com/gitlab-org/gitlab-runner/helpers/archives"
"gitlab.com/gitlab-org/gitlab-runner/helpers/formatter"
"gitlab.com/gitlab-org/gitlab-runner/log"
"gitlab.com/gitlab-org/gitlab-runner/network"
)
......@@ -102,7 +102,7 @@ func (c *ArtifactsUploaderCommand) createAndUpload() (bool, error) {
}
func (c *ArtifactsUploaderCommand) Execute(*cli.Context) {
formatter.SetRunnerFormatter()
log.SetRunnerFormatter()
if len(c.URL) == 0 || len(c.Token) == 0 {
logrus.Fatalln("Missing runner credentials")
......
......@@ -13,6 +13,7 @@ import (
"gitlab.com/gitlab-org/gitlab-runner/common"
"gitlab.com/gitlab-org/gitlab-runner/helpers/archives"
"gitlab.com/gitlab-org/gitlab-runner/helpers/url"
"gitlab.com/gitlab-org/gitlab-runner/log"
)
type CacheArchiverCommand struct {
......@@ -71,6 +72,8 @@ func (c *CacheArchiverCommand) upload() (bool, error) {
}
func (c *CacheArchiverCommand) Execute(*cli.Context) {
log.SetRunnerFormatter()
if c.File == "" {
logrus.Fatalln("Missing --file")
}
......
......@@ -14,8 +14,8 @@ import (
"gitlab.com/gitlab-org/gitlab-runner/common"
"gitlab.com/gitlab-org/gitlab-runner/helpers/archives"
"gitlab.com/gitlab-org/gitlab-runner/helpers/formatter"
"gitlab.com/gitlab-org/gitlab-runner/helpers/url"
"gitlab.com/gitlab-org/gitlab-runner/log"
)
type CacheExtractorCommand struct {
......@@ -81,7 +81,7 @@ func (c *CacheExtractorCommand) download() (bool, error) {
}
func (c *CacheExtractorCommand) Execute(context *cli.Context) {
formatter.SetRunnerFormatter()
log.SetRunnerFormatter()
if len(c.File) == 0 {
logrus.Fatalln("Missing cache file")
......
......@@ -5,8 +5,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"gitlab.com/gitlab-org/gitlab-runner/helpers/formatter"
)
const (
......@@ -39,7 +37,7 @@ var (
}
formats = map[string]logrus.Formatter{
FormatRunner: new(formatter.RunnerTextFormatter),
FormatRunner: new(RunnerTextFormatter),
FormatText: new(logrus.TextFormatter),
FormatJSON: new(logrus.JSONFormatter),
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment