github.com/AntonOrnatskyi/goproxy@v0.0.0-20190205095733-4526a9fa18b4/core/dst/debug.go (about)

     1  // Copyright 2014 The DST Authors. All rights reserved.
     2  // Use of this source code is governed by an MIT-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package dst
     6  
     7  import (
     8  	"os"
     9  	"strings"
    10  )
    11  
    12  var (
    13  	debugConnection bool
    14  	debugMux        bool
    15  	debugCC         bool
    16  )
    17  
    18  func init() {
    19  	debug := make(map[string]bool)
    20  	for _, s := range strings.Split(os.Getenv("DSTDEBUG"), ",") {
    21  		debug[strings.TrimSpace(s)] = true
    22  	}
    23  	debugConnection = debug["conn"]
    24  	debugMux = debug["mux"]
    25  	debugCC = debug["cc"]
    26  }