Skip to content

Commit

Permalink
Return the logger.Interface instead of the pointer of logger to avoid…
Browse files Browse the repository at this point in the history
… nil checking issue
  • Loading branch information
steven-zou committed Apr 20, 2018
1 parent 4da4dd6 commit a174369
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/jobservice/job/impl/logger/job_logger.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a174369

Please sign in to comment.