mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-21 23:21:26 +01:00
Log error if failed to create logger for job
Signed-off-by: Steven Zou <szou@vmware.com>
This commit is contained in:
parent
a69f86054f
commit
326e0d455a
@ -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