Skip to content

Commit 87d8a62

Browse files
committed
Added profiler in debug mode
1 parent 27c3eb6 commit 87d8a62

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: main.go

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import (
44
"flag"
55
"io"
66
"log"
7+
"net/http"
8+
_ "net/http/pprof"
79
"os"
810
"os/signal"
911

@@ -44,6 +46,9 @@ func main() {
4446
logfile := streams.OpenLogFileAs("inols-err.log")
4547
log.SetOutput(io.MultiWriter(logfile, os.Stderr))
4648
defer streams.CatchAndLogPanic()
49+
go func() {
50+
log.Println(http.ListenAndServe("localhost:6060", nil))
51+
}()
4752
} else {
4853
log.SetOutput(os.Stderr)
4954
}

0 commit comments

Comments
 (0)