Demote some log lines to DEBUG.

Now that we support log line filtering (as of 0090c063) it's good to be
a bit more fussy about what log levels are assigned to different things.

Here we make a few things that are implementation details log as DEBUG,
and prevent spurious errors from EvalValidateCount where it was returning
an empty EvalValidateError rather than nil when everything was okay.
This commit is contained in:
Martin Atkins 2015-10-11 10:45:33 -07:00
parent 0090c063e8
commit 8173cd25bb
4 changed files with 9 additions and 6 deletions

View File

@ -33,7 +33,7 @@ func configDir() (string, error) {
func homeDir() (string, error) {
// First prefer the HOME environmental variable
if home := os.Getenv("HOME"); home != "" {
log.Printf("Detected home directory from env var: %s", home)
log.Printf("[DEBUG] Detected home directory from env var: %s", home)
return home, nil
}

View File

@ -88,7 +88,7 @@ func CleanupClients() {
}(client)
}
log.Println("waiting for all plugin processes to complete...")
log.Println("[DEBUG] waiting for all plugin processes to complete...")
wg.Wait()
}
@ -326,7 +326,7 @@ func (c *Client) logStderr(r io.Reader) {
c.config.Stderr.Write([]byte(line))
line = strings.TrimRightFunc(line, unicode.IsSpace)
log.Printf("%s: %s", filepath.Base(c.config.Cmd.Path), line)
log.Printf("[DEBUG] %s: %s", filepath.Base(c.config.Cmd.Path), line)
}
if err == io.EOF {

View File

@ -513,7 +513,7 @@ func (c *Context) releaseRun(ch chan<- struct{}) {
func (c *Context) walk(
graph *Graph, operation walkOperation) (*ContextGraphWalker, error) {
// Walk the graph
log.Printf("[INFO] Starting graph walk: %s", operation.String())
log.Printf("[DEBUG] Starting graph walk: %s", operation.String())
walker := &ContextGraphWalker{Context: c, Operation: operation}
return walker, graph.Walk(walker)
}

View File

@ -49,10 +49,13 @@ func (n *EvalValidateCount) Eval(ctx EvalContext) (interface{}, error) {
}
RETURN:
return nil, &EvalValidateError{
if len(errs) != 0 {
err = &EvalValidateError{
Errors: errs,
}
}
return nil, err
}
// EvalValidateProvider is an EvalNode implementation that validates
// the configuration of a resource.