Skip to content

Fixed incorrect method use, log.Warn -> log.Infof.#1132

Merged
kontsevoy merged 1 commit into
masterfrom
rjones/warn-to-warnf
Jul 13, 2017
Merged

Fixed incorrect method use, log.Warn -> log.Infof.#1132
kontsevoy merged 1 commit into
masterfrom
rjones/warn-to-warnf

Conversation

@russjones
Copy link
Copy Markdown
Contributor

@russjones russjones commented Jul 12, 2017

Purpose

At the moment we are logging a warning if /etc/login.defs doesn't exist. This probably shouldn't be a warning but should logged at the info level because it's perfectly valid for someone to not have /etc/login.defs but it's worth knowing that the default path was used nonetheless.

In addition, we were using log.Warn instead of log.Warnf which caused the error message to be difficult to read.

WARN[0033] Unable to open %q: %v: returning default path: %q/etc/login.defsopen /etc/login.defs: no such file or directoryPATH=/bin:/usr/bin:/usr/local/bin:/sbin  file=srv/exec.go:380 func=srv.getDefaultEnvPath

Implementation

  • Change log.Warn to log.Infof.

@russjones russjones changed the title Fixed incorrect method use, log.Warn -> log.Warnf. Fixed incorrect method use, log.Warn -> log.Infof. Jul 12, 2017
@kontsevoy kontsevoy self-requested a review July 12, 2017 20:48
@kontsevoy
Copy link
Copy Markdown
Contributor

lgtm

@kontsevoy
Copy link
Copy Markdown
Contributor

retest this please

1 similar comment
@kontsevoy
Copy link
Copy Markdown
Contributor

retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants