MCPcopy Index your code
hub / github.com/foxcpp/maddy / initDebug

Function initDebug

maddy.go:247–268  ·  view source on GitHub ↗
(c *cli.Context)

Source from the content-addressed store, hash-verified

245}
246
247func initDebug(c *cli.Context) {
248 if !enableDebugFlags {
249 return
250 }
251
252 if c.IsSet("debug.pprof") {
253 profileEndpoint := c.String("debug.pprof")
254 go func() {
255 log.Println("listening on", "http://"+profileEndpoint, "for profiler requests")
256 log.Println("failed to listen on profiler endpoint:", http.ListenAndServe(profileEndpoint, nil))
257 }()
258 }
259
260 // These values can also be affected by environment so set them
261 // only if argument is specified.
262 if c.IsSet("debug.mutexproffract") {
263 runtime.SetMutexProfileFraction(c.Int("debug.mutexproffract"))
264 }
265 if c.IsSet("debug.blockprofrate") {
266 runtime.SetBlockProfileRate(c.Int("debug.blockprofrate"))
267 }
268}
269
270func InitDirs(c *container.C) error {
271 if c.Config.StateDirectory == "" {

Callers 1

RunFunction · 0.85

Calls 4

PrintlnFunction · 0.92
IsSetMethod · 0.80
IntMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected