+ Runtime: Add go version to debug infos

This commit is contained in:
Guillaume J. Charmes 2013-05-08 15:26:44 -07:00
Родитель 3484781a6f
Коммит d6c24092eb
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -11,6 +11,7 @@ import (
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"runtime"
"strconv"
@ -284,9 +285,10 @@ func (srv *Server) CmdInfo(stdin io.ReadCloser, stdout io.Writer, args ...string
VERSION,
imgcount)
if !rcli.DEBUG_FLAG {
if os.Getenv("DEBUG") == "" {
return nil
}
fmt.Fprintf(stdout, "Go version: %s\n", runtime.Version())
fmt.Fprintln(stdout, "debug mode enabled")
fmt.Fprintf(stdout, "fds: %d\ngoroutines: %d\n", getTotalUsedFds(), runtime.NumGoroutine())
return nil