From: Tom Clegg Date: Fri, 24 Sep 2021 18:09:16 +0000 (-0400) Subject: Improve logging. X-Git-Url: https://git.arvados.org/lightning.git/commitdiff_plain/c4640fcf97142c016190909ca67513a508d81aa2 Improve logging. refs #17966 Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/slicenumpy.go b/slicenumpy.go index 557f0c5591..7b997e7a78 100644 --- a/slicenumpy.go +++ b/slicenumpy.go @@ -236,7 +236,7 @@ func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s return err } defer f.Close() - log.Infof("reading %s", infile) + log.Infof("%04d: reading %s", infileIdx, infile) err = DecodeLibrary(f, strings.HasSuffix(infile, ".gz"), func(ent *LibraryEntry) error { for _, tv := range ent.TileVariants { variants := seq[tv.Tag] @@ -262,7 +262,7 @@ func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s // TODO: filters - log.Infof("renumber/dedup variants for tags %d-%d", tagstart, tagend) + log.Infof("%04d: renumber/dedup variants for tags %d-%d", infileIdx, tagstart, tagend) variantRemap := make([][]tileVariantID, tagend-tagstart) throttleCPU := throttle{Max: runtime.GOMAXPROCS(0)} for tag, variants := range seq { @@ -313,7 +313,7 @@ func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s throttleCPU.Wait() annotationsFilename := fmt.Sprintf("%s/matrix.%04d.annotations.csv", *outputDir, infileIdx) - log.Infof("writing %s", annotationsFilename) + log.Infof("%04d: writing %s", infileIdx, annotationsFilename) annof, err := os.Create(annotationsFilename) if err != nil { return err @@ -355,7 +355,7 @@ func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s } throttleNumpyMem.Acquire() - log.Infof("%s: preparing numpy", infile) + log.Infof("%04d: preparing numpy", infileIdx) rows := len(cgnames) cols := 2 * int(tagend-tagstart) out := make([]int16, rows*cols) @@ -387,7 +387,7 @@ func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s "filename": fnm, "rows": rows, "cols": cols, - }).Info("writing numpy") + }).Infof("%04d: writing numpy", infileIdx) npw.Shape = []int{rows, cols} npw.WriteInt16(out) err = bufw.Flush()