diff --git a/analysis.go b/analysis.go index 8da4e8b..4f1ac88 100644 --- a/analysis.go +++ b/analysis.go @@ -6,6 +6,8 @@ import ( "sync" ) +var Verbose bool + var QueueBufferSize = 4096000 var ( diff --git a/bei.go b/bei.go index c0d6b5e..5897b78 100644 --- a/bei.go +++ b/bei.go @@ -174,5 +174,14 @@ func parseState(buf []byte) (Board, error) { b[SpaceEnteredOpponent] = 0 } } + + if Verbose { + var logMessage []byte + for _, v := range b { + logMessage = append(logMessage, []byte(fmt.Sprintf("%4d", int(v)))...) + } + log.Println(string(logMessage)) + } + return b, nil } diff --git a/cmd/tabula/main.go b/cmd/tabula/main.go index c4131ea..cc32200 100644 --- a/cmd/tabula/main.go +++ b/cmd/tabula/main.go @@ -13,6 +13,7 @@ func main() { var pips bool flag.StringVar(&address, "address", "", "Listen for BEI connections on specified address (TCP)") flag.BoolVar(&pips, "pips", false, "Print table of pseudopip values") + flag.BoolVar(&tabula.Verbose, "verbose", false, "Print state of each request") flag.Parse() if pips {