Added --verbose flag and logging for backend

This commit is contained in:
Philipp Böhm 2014-07-29 20:23:45 +02:00
parent f5acffa2c5
commit 64f0703c67
3 changed files with 14 additions and 8 deletions

View File

@ -27,6 +27,10 @@ func RunBackend(conn *RedisConnection) {
func HandleRequest(line string, conn *RedisConnection) {
defer fmt.Printf("END\n")
if Verbose {
fmt.Printf("LOG\t'%s'\n", line)
}
parts := strings.Split(line, "\t")
if len(parts) != 6 {
return

View File

@ -209,7 +209,6 @@ func templates_index_html() ([]byte, error) {
)
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
@ -223,5 +222,4 @@ func Asset(name string) ([]byte, error) {
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() ([]byte, error){
"templates/index.html": templates_index_html,
}

View File

@ -16,6 +16,7 @@ var (
DdnsDomain string
DdnsWebListenSocket string
DdnsRedisHost string
Verbose bool
)
func init() {
@ -27,6 +28,9 @@ func init() {
flag.StringVar(&DdnsRedisHost, "redis", ":6379",
"The Redis socket that should be used")
flag.BoolVar(&Verbose, "verbose", false,
"Be more verbose")
}
func ValidateCommandArgs() {