Browse Source

remove default logger

tags/v0.9.0
jimzhan 9 years ago
parent
commit
7bee5b456d
2 changed files with 3 additions and 53 deletions
  1. +0
    -51
      logger.go
  2. +3
    -2
      server.go

+ 0
- 51
logger.go View File

package rex

import "github.com/Sirupsen/logrus"

func Info(message string) {
logrus.Info(message)
}

func Infof(format string, args ...interface{}) {
logrus.Infof(format, args...)
}

func Debug(message string) {
logrus.Debug(message)
}

func Debugf(format string, args ...interface{}) {
logrus.Debugf(format, args...)
}

func Warn(message string) {
logrus.Warn(message)
}

func Warnf(format string, args ...interface{}) {
logrus.Warnf(format, args...)
}

func Error(message string) {
logrus.Error(message)
}

func Errorf(format string, args ...interface{}) {
logrus.Errorf(format, args...)
}

func Fatal(message string) {
logrus.Fatal(message)
}

func Fatalf(format string, args ...interface{}) {
logrus.Fatalf(format, args...)
}

func Panic(message string) {
logrus.Panic(message)
}

func Panicf(format string, args ...interface{}) {
logrus.Panicf(format, args...)
}

+ 3
- 2
server.go View File

"sync" "sync"
"time" "time"


log "github.com/Sirupsen/logrus"
"github.com/goanywhere/env" "github.com/goanywhere/env"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )


go func() { go func() {
time.Sleep(500 * time.Millisecond) time.Sleep(500 * time.Millisecond)
Infof("Application server is listening at %d", port)
log.Infof("Application server is listening at %d", port)
}() }()


if err := http.ListenAndServe(fmt.Sprintf(":%d", port), self); err != nil { if err := http.ListenAndServe(fmt.Sprintf(":%d", port), self); err != nil {
Fatalf("Failed to start the server: %v", err)
log.Fatalf("Failed to start the server: %v", err)
} }
} }



Loading…
Cancel
Save