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) { func HandleRequest(line string, conn *RedisConnection) {
defer fmt.Printf("END\n") defer fmt.Printf("END\n")
if Verbose {
fmt.Printf("LOG\t'%s'\n", line)
}
parts := strings.Split(line, "\t") parts := strings.Split(line, "\t")
if len(parts) != 6 { if len(parts) != 6 {
return return

View File

@ -1,10 +1,10 @@
package main package main
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"fmt" "fmt"
"io" "io"
) )
func bindata_read(data []byte, name string) ([]byte, error) { func bindata_read(data []byte, name string) ([]byte, error) {
@ -204,12 +204,11 @@ func templates_index_html() ([]byte, error) {
0xc0, 0xd0, 0x7b, 0xb7, 0xa7, 0x8e, 0xc3, 0xf2, 0x32, 0x37, 0x0e, 0xcb, 0xc0, 0xd0, 0x7b, 0xb7, 0xa7, 0x8e, 0xc3, 0xf2, 0x32, 0x37, 0x0e, 0xcb,
0x7f, 0xf4, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x06, 0x0e, 0x7f, 0xf4, 0xfa, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x06, 0x0e,
0xd9, 0x05, 0x1b, 0x00, 0x00, 0xd9, 0x05, 0x1b, 0x00, 0x00,
}, },
"templates/index.html", "templates/index.html",
) )
} }
// Asset loads and returns the asset for the given name. // Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
@ -221,7 +220,6 @@ func Asset(name string) ([]byte, error) {
} }
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string] func() ([]byte, error) { var _bindata = map[string]func() ([]byte, error){
"templates/index.html": templates_index_html, "templates/index.html": templates_index_html,
} }

View File

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