Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cli/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ var IsDockerEnv bool
// Config contains the configuration
type Config struct {
Global struct {
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
middlewares.SlackConfig `mapstructure:",squash"`
middlewares.SaveConfig `mapstructure:",squash"`
middlewares.MailConfig `mapstructure:",squash"`
LogFormat string `gcfg:"log-format" mapstructure:"log-format"`
}
ExecJobs map[string]*ExecJobConfig `gcfg:"job-exec" mapstructure:"job-exec,squash"`
RunJobs map[string]*RunJobConfig `gcfg:"job-run" mapstructure:"job-run,squash"`
Expand Down Expand Up @@ -134,6 +135,12 @@ func (c *Config) buildDockerClient() (*docker.Client, error) {
}

func (c *Config) buildLogger() core.Logger {
// Set to default log format if not specified
logFormat := c.Global.LogFormat
if logFormat == "" {
logFormat = defaultLogFormat
}

stdout := logging.NewLogBackend(os.Stdout, "", 0)
// Set the backends to be used.
logging.SetBackend(stdout)
Expand Down