mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
Improve debug logging in golang
This commit is contained in:
parent
5353e9e90f
commit
08e005d45f
3 changed files with 10 additions and 9 deletions
8
util.go
8
util.go
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue