Skip to content

Commit

Permalink
refactor: changed logging of highest error using logger
Browse files Browse the repository at this point in the history
  • Loading branch information
FUSAKLA committed Jun 3, 2019
1 parent 27fedb8 commit d9368aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions cmd/thanos/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ func checkRulesFiles(logger log.Logger, files *[]string) error {
return nil
}

type ThanosRuleGroup struct{
PartialResponseStrategy string `yaml:"partial_response_strategy"`
rulefmt.RuleGroup `yaml:",inline"`
type ThanosRuleGroup struct {
PartialResponseStrategy string `yaml:"partial_response_strategy"`
rulefmt.RuleGroup `yaml:",inline"`
}

type ThanosRuleGroups struct {
Groups []ThanosRuleGroup `yaml:"groups"`
}


func checkRules(logger log.Logger, filename string) (int, tsdb.MultiError) {
level.Info(logger).Log("msg", "checking", "filename", filename)
checkErrors := tsdb.MultiError{}
Expand Down
2 changes: 1 addition & 1 deletion cmd/thanos/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func main() {
}

if err := cmds[cmd](&g, logger, metrics, tracer, *logLevel == "debug"); err != nil {
fmt.Fprintln(os.Stderr, errors.Wrapf(err, "%s command failed", cmd))
level.Error(logger).Log("err", errors.Wrapf(err, "%s command failed", cmd))
os.Exit(1)
}

Expand Down

0 comments on commit d9368aa

Please sign in to comment.