@@ -3,6 +3,7 @@ package fastTrace
3
3
import (
4
4
"bufio"
5
5
"fmt"
6
+ "github.com/fatih/color"
6
7
"github.com/nxtrace/NTrace-core/ipgeo"
7
8
"github.com/nxtrace/NTrace-core/printer"
8
9
"github.com/nxtrace/NTrace-core/trace"
@@ -44,7 +45,10 @@ type IpListElement struct {
44
45
var oe = false
45
46
46
47
func (f * FastTracer ) tracert (location string , ispCollection ISPCollection ) {
47
- fmt .Printf ("%s『%s %s 』%s\n " , printer .YELLOW_PREFIX , location , ispCollection .ISPName , printer .RESET_PREFIX )
48
+ //fmt.Printf("%s『%s %s 』%s\n", printer.YELLOW_PREFIX, location, ispCollection.ISPName, printer.RESET_PREFIX)
49
+ fmt .Fprintf (color .Output , "%s\n " ,
50
+ color .New (color .FgYellow , color .Bold ).Sprint ("『 " + location + ispCollection .ISPName + " 』" ),
51
+ )
48
52
fmt .Printf ("traceroute to %s, %d hops max, %d byte packets\n " , ispCollection .IP , f .ParamsFastTrace .MaxHops , f .ParamsFastTrace .PktSize )
49
53
50
54
ip , err := util .DomainLookUp (ispCollection .IP , "4" , "" , true )
@@ -274,8 +278,14 @@ func testFile(paramsFastTrace ParamsFastTrace, tm bool) {
274
278
}
275
279
276
280
for _ , ip := range ipList {
277
- fmt .Printf ("%s『%s』%s\n " , printer .YELLOW_PREFIX , ip .Desc , printer .RESET_PREFIX )
278
- fmt .Printf ("traceroute to %s, %d hops max, %d byte packets\n " , ip .Ip , paramsFastTrace .MaxHops , paramsFastTrace .PktSize )
281
+ fmt .Fprintf (color .Output , "%s\n " ,
282
+ color .New (color .FgYellow , color .Bold ).Sprint ("『 " + ip .Desc + "』" ),
283
+ )
284
+ if util .EnableHidDstIP == "" {
285
+ fmt .Printf ("traceroute to %s, %d hops max, %d bytes packets\n " , ip .Ip , paramsFastTrace .MaxHops , paramsFastTrace .PktSize )
286
+ } else {
287
+ fmt .Printf ("traceroute to %s, %d hops max, %d bytes packets\n " , util .HideIPPart (ip .Ip ), paramsFastTrace .MaxHops , paramsFastTrace .PktSize )
288
+ }
279
289
var srcAddr string
280
290
if ip .Version4 {
281
291
if paramsFastTrace .SrcDev != "" {
0 commit comments