Merge pull request #2911 from kolyshkin/debug-enable-file-line

logging: enable file/line info if --debug is set
This commit is contained in:
Akihiro Suda
2021-04-28 12:07:21 +09:00
committed by GitHub
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -24,6 +24,7 @@ type Config struct {
LogFormat string
LogFilePath string
LogPipeFd int
LogCaller bool
}
func ForwardLogs(logPipe io.ReadCloser) chan error {
@@ -77,6 +78,7 @@ func ConfigureLogging(config Config) error {
}
logrus.SetLevel(config.LogLevel)
logrus.SetReportCaller(config.LogCaller)
// XXX: while 0 is a valid fd (usually stdin), here we assume
// that we never deliberately set LogPipeFd to 0.
+1
View File
@@ -190,6 +190,7 @@ func createLogConfig(context *cli.Context) logs.Config {
LogLevel: logrus.InfoLevel,
LogFilePath: logFilePath,
LogFormat: context.GlobalString("log-format"),
LogCaller: context.GlobalBool("debug"),
}
if context.GlobalBool("debug") {
config.LogLevel = logrus.DebugLevel