diff --git a/gorush.go b/gorush.go index d604088..5eb77c9 100644 --- a/gorush.go +++ b/gorush.go @@ -49,8 +49,6 @@ func main() { gopush.PushConf.Core.Port = *port } - - if err = gopush.InitLog(); err != nil { log.Println(err) diff --git a/gorush/log.go b/gorush/log.go index fc26755..41157fd 100644 --- a/gorush/log.go +++ b/gorush/log.go @@ -1,9 +1,9 @@ package gopush import ( + "errors" "github.com/Sirupsen/logrus" "os" - "errors" ) func InitLog() error { @@ -26,19 +26,19 @@ func InitLog() error { // set logger if err := SetLogLevel(LogAccess, PushConf.Log.AccessLevel); err != nil { - return errors.New("Set access log level error: "+ err.Error()) + return errors.New("Set access log level error: " + err.Error()) } if err := SetLogLevel(LogError, PushConf.Log.ErrorLevel); err != nil { - return errors.New("Set error log level error: "+ err.Error()) + return errors.New("Set error log level error: " + err.Error()) } if err = SetLogOut(LogAccess, PushConf.Log.AccessLog); err != nil { - return errors.New("Set access log path error: "+ err.Error()) + return errors.New("Set access log path error: " + err.Error()) } if err = SetLogOut(LogError, PushConf.Log.ErrorLog); err != nil { - return errors.New("Set error log path error: "+ err.Error()) + return errors.New("Set error log path error: " + err.Error()) } return nil diff --git a/gorush/log_test.go b/gorush/log_test.go index 806ad76..42ecb76 100644 --- a/gorush/log_test.go +++ b/gorush/log_test.go @@ -1,8 +1,8 @@ package gopush import ( - "github.com/stretchr/testify/assert" "github.com/Sirupsen/logrus" + "github.com/stretchr/testify/assert" "testing" )