1
0
mirror of https://github.com/taigrr/godns synced 2025-01-18 04:03:25 -08:00

Output stack trace

This commit is contained in:
Timothy 2014-06-06 21:45:37 +08:00
parent 1c7de425f7
commit e1174bb67e
2 changed files with 5 additions and 1 deletions

4
.gitignore vendored
View File

@ -21,4 +21,6 @@ _testmain.go
*.exe *.exe
*.test *.test
config.json config.json
*.swp
godns

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
log "github.com/cihub/seelog" log "github.com/cihub/seelog"
"os" "os"
"runtime/debug"
"strings" "strings"
"time" "time"
) )
@ -39,6 +40,7 @@ func dns_loop(loop chan bool) {
defer func() { defer func() {
if err := recover(); err != nil { if err := recover(); err != nil {
log.Error(err) log.Error(err)
log.Info("Stack trace:\n" + string(debug.Stack()))
} }
}() }()