* some debugging and fixing in the proxy (still needs some work)

* added a logger and stringers for message types
This commit is contained in:
betzalel
2017-07-11 16:50:06 +03:00
parent 092f92264a
commit 18bef62b79
28 changed files with 1340 additions and 726 deletions

52
logger/logger.go Normal file
View File

@@ -0,0 +1,52 @@
package logger
import "fmt"
type Logger interface {
Debug(v ...interface{})
Debugf(format string, v ...interface{})
Info(v ...interface{})
Infof(format string, v ...interface{})
Warn(v ...interface{})
Warnf(format string, v ...interface{})
Error(v ...interface{})
Errorf(format string, v ...interface{})
Fatal(v ...interface{})
Fatalf(format string, v ...interface{})
}
func Debug(v ...interface{}) {
fmt.Print("[Debug] ")
fmt.Println(v...)
}
func Debugf(format string, v ...interface{}) {
fmt.Printf("[Debug] "+format+"\n", v...)
}
func Info(v ...interface{}) {
fmt.Print("[Info] ")
fmt.Println(v...)
}
func Infof(format string, v ...interface{}) {
fmt.Printf("[Info] "+format+"\n", v...)
}
func Warn(v ...interface{}) {
fmt.Print("[Warn] ")
fmt.Println(v...)
}
func Warnf(format string, v ...interface{}) {
fmt.Printf("[Warn] "+format+"\n", v...)
}
func Error(v ...interface{}) {
fmt.Print("[Error] ")
fmt.Println(v...)
}
func Errorf(format string, v ...interface{}) {
fmt.Printf("[Error] "+format+"\n", v...)
}
func Fatal(v ...interface{}) {
fmt.Print("[Fatal] ")
fmt.Println(v...)
}
func Fatalf(format string, v ...interface{}) {
fmt.Printf("[Fatal] "+format+"\n", v)
}