···2323 "runtime"
2424 "sort"
2525 "strconv"
2626+ "strings"
2627 "sync"
2728 "syscall"
2829 "time"
···655656 }
656657}
657658659659+func srcLogLevelIsDebug() bool {
660660+ lvl := os.Getenv("SRC_LOG_LEVEL")
661661+ return strings.EqualFold(lvl, "dbug") || strings.EqualFold(lvl, "debug")
662662+}
663663+658664func main() {
659665 defaultIndexDir := os.Getenv("DATA_DIR")
660666 if defaultIndexDir == "" {
···667673 listen := flag.String("listen", ":6072", "listen on this address.")
668674 hostname := flag.String("hostname", hostnameBestEffort(), "the name we advertise to Sourcegraph when asking for the list of repositories to index. Can also be set via the NODE_NAME environment variable.")
669675 cpuFraction := flag.Float64("cpu_fraction", 1.0, "use this fraction of the cores for indexing.")
670670- dbg := flag.Bool("debug", os.Getenv("SRC_LOG_LEVEL") == "dbug", "turn on more verbose logging.")
676676+ dbg := flag.Bool("debug", srcLogLevelIsDebug(), "turn on more verbose logging.")
671677672678 // non daemon mode for debugging/testing
673679 debugList := flag.Bool("debug-list", false, "do not start the indexserver, rather list the repositories owned by this indexserver then quit.")