去掉stdout 日志颜色,以便executor只获取到日志正文

This commit is contained in:
nuknal
2024-05-22 18:15:40 +08:00
parent eb6e0bc95a
commit 357b62422e
4 changed files with 25 additions and 8 deletions

View File

@@ -3,7 +3,7 @@ package cmd
import (
"fmt"
"github.com/k0kubun/pp/v3"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"starwiz.cn/sjy01/preprocessing/extract"
)
@@ -26,11 +26,27 @@ var extractCmd = &cobra.Command{
panic(err)
}
pp.Println(params)
log.Println("input data:", params.InputData)
log.Println("output path:", params.OutputPath)
log.Println("temp path:", params.TempPath)
log.Println("data id:", params.DataId)
log.Println("satellite:", params.Satellite)
e := extract.NewExtractor(params)
aos, _ := e.ExtractAosData()
dats, _ := e.ExtractOriginalImageData(aos)
aos, err := e.ExtractAosData()
if err != nil {
panic(err)
}
dats, err := e.ExtractOriginalImageData(aos)
if err != nil {
panic(err)
}
if len(dats) == 0 {
panic(fmt.Errorf("no segment data found"))
}
for i, d := range dats {
e.SeprateAuxAndImgData(d, i)
}

View File

@@ -13,6 +13,7 @@ var (
)
func (e *Extractor) ExtractAux(auxfile, xlsxfile string) ([]*AuxFrameHead, []*AuxFocalBox, []*AuxPlatform, error) {
log.Println("extract aux data from", auxfile, "to", xlsxfile)
os.Remove(xlsxfile)
if err := createAuxXlsx(xlsxfile); err != nil {
return nil, nil, nil, err

View File

@@ -57,14 +57,14 @@ const L0TPL = `<?xml version="1.0" encoding="UTF-8"?>
<inputFileList>
<inputdata>{{.InputData}}</inputdata>
</inputFileList>
<outputfilelist num="3">
<outputfilelist>
<outputPath>{{.OutputPath}}</outputPath>
<TempPath>{{.TempPath}}</TempPath>
<reportFile>{{.ReportFile}}</reportFile>
<resultFile>{{.ResultFile}}</resultFile>
</outputfilelist>
<params>
<stationId>WN</stationId>
<stationId>QH</stationId>
<sensor>PMS</sensor>
<dataId>{{.DataId}}</dataId>
<satelliteId>SJY01</satelliteId>

View File

@@ -38,8 +38,8 @@ func init() {
FullTimestamp: true,
TimestampFormat: "2006-01-02.15:04:05",
ForceFormatting: true,
ForceColors: true,
DisableColors: false,
ForceColors: false,
DisableColors: true,
}
fileFormatter = &prefixed.TextFormatter{
FullTimestamp: true,