[ci skip] fix format.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-04-05 15:04:50 +08:00
parent 449ce80649
commit 1a6e697416
3 changed files with 6 additions and 8 deletions

View File

@ -49,8 +49,6 @@ func main() {
gopush.PushConf.Core.Port = *port gopush.PushConf.Core.Port = *port
} }
if err = gopush.InitLog(); err != nil { if err = gopush.InitLog(); err != nil {
log.Println(err) log.Println(err)

View File

@ -1,9 +1,9 @@
package gopush package gopush
import ( import (
"errors"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"os" "os"
"errors"
) )
func InitLog() error { func InitLog() error {
@ -26,19 +26,19 @@ func InitLog() error {
// set logger // set logger
if err := SetLogLevel(LogAccess, PushConf.Log.AccessLevel); err != nil { 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 { 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 { 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 { 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 return nil

View File

@ -1,8 +1,8 @@
package gopush package gopush
import ( import (
"github.com/stretchr/testify/assert"
"github.com/Sirupsen/logrus" "github.com/Sirupsen/logrus"
"github.com/stretchr/testify/assert"
"testing" "testing"
) )