Bläddra i källkod

remove default logger

tags/v0.9.0
jimzhan 9 år sedan
förälder
incheckning
7bee5b456d
2 ändrade filer med 3 tillägg och 53 borttagningar
  1. +0
    -51
      logger.go
  2. +3
    -2
      server.go

+ 0
- 51
logger.go Visa fil

@@ -1,51 +0,0 @@
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 Visa fil

@@ -10,6 +10,7 @@ import (
"sync"
"time"

log "github.com/Sirupsen/logrus"
"github.com/goanywhere/env"
"github.com/gorilla/mux"
)
@@ -187,11 +188,11 @@ func (self *server) Run() {

go func() {
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 {
Fatalf("Failed to start the server: %v", err)
log.Fatalf("Failed to start the server: %v", err)
}
}


Laddar…
Avbryt
Spara