diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-13 15:42:51 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-13 15:42:51 +1000 |
commit | f633909141dc1e2c2e49b94e5e478e99be51a9cb (patch) | |
tree | b1bb3c29d49a734d46e87300840df256ec203743 /debugon.go | |
parent | 79b7cc082cac1904b87bbe7996df5a8824f7c2d8 (diff) |
Markdown output from DumpDebugStats
Diffstat (limited to 'debugon.go')
-rw-r--r-- | debugon.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -139,12 +139,13 @@ func DisableLogging() { // DumpDebugStats will print out the curring timings for each parser if built with -tags debug func DumpDebugStats() { sort.Slice(parsers, func(i, j int) bool { - return parsers[i].Self >= parsers[j].Self + return parsers[i].Cumulative >= parsers[j].Cumulative }) - fmt.Println("Parser stats:") - fmt.Println(" var name matches total time self time calls errors location ") + fmt.Println() + fmt.Println("| var name | matches | total time | self time | calls | errors | location ") + fmt.Println("| -------------------- | -------------------- | --------------- | --------------- | ---------- | ---------- | ----------") for _, parser := range parsers { - fmt.Printf("%20s %20s %15s %15s %10d calls %10d errors %s\n", parser.Var, parser.Match, parser.Cumulative.String(), parser.Self.String(), parser.Calls, parser.Errors, parser.Location) + fmt.Printf("| %20s | %20s | %15s | %15s | %10d | %10d | %s\n", parser.Var, parser.Match, parser.Cumulative.String(), parser.Self.String(), parser.Calls, parser.Errors, parser.Location) } } |