Merge pull request #6019 from steven-zou/log_creation_failure

Log error if failed to create logger for job
This commit is contained in:
Wenkai Yin 2018-10-11 19:05:54 +08:00 committed by GitHub
commit 4d11503c24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ type JobLogger struct {
func New(logPath string, level string) logger.Interface {
f, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
logger.Errorf("Failed to create job logger: %s", err)
return nil
}
logLevel := parseLevel(level)