mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 21:54:13 +01:00
Merge pull request #6019 from steven-zou/log_creation_failure
Log error if failed to create logger for job
This commit is contained in:
commit
4d11503c24
@ -20,6 +20,7 @@ type JobLogger struct {
|
|||||||
func New(logPath string, level string) logger.Interface {
|
func New(logPath string, level string) logger.Interface {
|
||||||
f, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, 0644)
|
f, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
logger.Errorf("Failed to create job logger: %s", err)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
logLevel := parseLevel(level)
|
logLevel := parseLevel(level)
|
||||||
|
Loading…
Reference in New Issue
Block a user