From c83838e1baa630b3f0a410190e212c2f948be994 Mon Sep 17 00:00:00 2001 From: M09Ic Date: Wed, 4 Jan 2023 11:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80extract=E4=B8=8Ecrawl?= =?UTF-8?q?=E7=9A=84=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/baseline.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkg/baseline.go b/pkg/baseline.go index c816aa0..e296deb 100644 --- a/pkg/baseline.go +++ b/pkg/baseline.go @@ -296,10 +296,16 @@ func (bl *Baseline) ColorString() string { line.WriteString(" ") } if len(bl.URLs) > 0 { - line.WriteString("\n") + line.WriteString("\n crawl: \n") } for _, u := range bl.URLs { - line.WriteString("\t" + logs.PurpleLine(u) + "\n") + line.WriteString("\t" + logs.GreenLine(u) + "\n") + } + if len(bl.Extracteds) > 0 { + for _, e := range bl.Extracteds { + line.WriteString(" " + e.Name + ": \n\t") + line.WriteString(logs.GreenLine(strings.Join(e.ExtractResult, "\n\t"))) + } } return line.String() } @@ -343,11 +349,17 @@ func (bl *Baseline) String() string { line.WriteString(" ") } if len(bl.URLs) > 0 { - line.WriteString("\n") + line.WriteString("\n crawl: \n") } for _, u := range bl.URLs { line.WriteString("\t" + u + "\n") } + if len(bl.Extracteds) > 0 { + for _, e := range bl.Extracteds { + line.WriteString(" " + e.Name + ": \n\t") + line.WriteString(strings.Join(e.ExtractResult, "\n\t")) + } + } return line.String() }