去掉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 ( import (
"fmt" "fmt"
"github.com/k0kubun/pp/v3" log "github.com/sirupsen/logrus"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"starwiz.cn/sjy01/preprocessing/extract" "starwiz.cn/sjy01/preprocessing/extract"
) )
@@ -26,11 +26,27 @@ var extractCmd = &cobra.Command{
panic(err) 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) e := extract.NewExtractor(params)
aos, _ := e.ExtractAosData() aos, err := e.ExtractAosData()
dats, _ := e.ExtractOriginalImageData(aos) 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 { for i, d := range dats {
e.SeprateAuxAndImgData(d, i) e.SeprateAuxAndImgData(d, i)
} }

View File

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

View File

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

View File

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