mirror of
https://github.com/Open-Argon/argon-v3.git
synced 2025-12-06 08:56:07 +00:00
add debug
This commit is contained in:
21
src/debug.go
Normal file
21
src/debug.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
var debug = os.Getenv("__ARGON_DEBUG__") == "true"
|
||||
|
||||
func debugPrintln(a ...interface{}) {
|
||||
if debug {
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("debugPrintln: panic:", r)
|
||||
}
|
||||
}()
|
||||
fmt.Println(a...)
|
||||
}()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user