mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-13 19:21:56 +01:00
Merge pull request #4738 from steven-zou/fix_nil_job_logger_issue
Return the logger.Interface instead of the pointer of logger to avoid nil checking issue
This commit is contained in:
commit
641f01eb0e
@ -5,6 +5,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/vmware/harbor/src/common/utils/log"
|
||||
"github.com/vmware/harbor/src/jobservice/logger"
|
||||
)
|
||||
|
||||
//JobLogger is an implementation of logger.Interface.
|
||||
@ -16,7 +17,7 @@ type JobLogger struct {
|
||||
|
||||
//New logger
|
||||
//nil might be returned
|
||||
func New(logPath string, level string) *JobLogger {
|
||||
func New(logPath string, level string) logger.Interface {
|
||||
f, err := os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user