Improve debug logging in golang

This commit is contained in:
Ryan Dahl 2018-05-25 12:25:55 -04:00
parent 5353e9e90f
commit 08e005d45f
3 changed files with 10 additions and 9 deletions

View file

@ -1,10 +1,18 @@
package main
import (
"fmt"
"net/url"
"os"
)
func logDebug(format string, v ...interface{}) {
// Unless the debug flag is specified, discard logs.
if *flagDebug {
fmt.Printf(format+"\n", v)
}
}
func assert(cond bool, msg string) {
if !cond {
panic(msg)