| 13 | ) |
| 14 | |
| 15 | func setupDebugging(opts state.NylonOptions) { |
| 16 | if opts.DBG_trace { |
| 17 | f, err := os.Create("trace.out") |
| 18 | if err != nil { |
| 19 | log.Fatal(err) |
| 20 | } |
| 21 | err = trace.Start(f) |
| 22 | defer trace.Stop() |
| 23 | if err != nil { |
| 24 | return |
| 25 | } |
| 26 | log.Println("Started tracing") |
| 27 | } |
| 28 | if opts.DBG_debug { |
| 29 | go func() { |
| 30 | log.Println(http.ListenAndServe("0.0.0.0:6060", nil)) |
| 31 | }() |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func readCentralConfig(centralPath, nodePath string, tunables *state.RouterTunables) (*state.CentralCfg, error) { |
| 36 | var centralCfg state.CentralCfg |