Skip to content

Commit

Permalink
fix: 修正 log 输出功能在 Fast Trace 不可用的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlleo committed Oct 19, 2022
1 parent fdeaf11 commit 7b9912f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fast_trace/fast_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type FastTracer struct {
TracerouteMethod trace.Method
}

var outEnable bool = false
var oe bool = false

func (f *FastTracer) tracert(location string, ispCollection ISPCollection) {
fp, err := os.OpenFile("/tmp/trace.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, os.ModePerm)
Expand Down Expand Up @@ -48,7 +48,7 @@ func (f *FastTracer) tracert(location string, ispCollection ISPCollection) {
}

if f.TracerouteMethod == trace.ICMPTrace {
if outEnable {
if oe {
conf.RealtimePrinter = tracelog.RealtimePrinter
} else {
conf.RealtimePrinter = printer.RealtimePrinter
Expand Down Expand Up @@ -114,6 +114,8 @@ func (f *FastTracer) testEDU() {
func FastTest(tm bool, outEnable bool) {
var c string

oe = outEnable

fmt.Println("您想测试哪些ISP的路由?\n1. 国内四网\n2. 电信\n3. 联通\n4. 移动\n5. 教育网")
fmt.Print("请选择选项:")
fmt.Scanln(&c)
Expand Down

0 comments on commit 7b9912f

Please sign in to comment.