mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
Start to use leveled log
This commit is contained in:
@ -2,7 +2,7 @@ package obiformats
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"sync"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -1,7 +1,7 @@
|
||||
package obiformats
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
|
@ -8,10 +8,11 @@ import "C"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"unsafe"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/cutils"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
@ -61,7 +62,7 @@ func _FastseqReader(seqfile C.fast_kseq_p,
|
||||
slice = append(slice, rep)
|
||||
ii++
|
||||
if ii >= batch_size {
|
||||
// log.Printf("\n==> Pushing sequence batch\n")
|
||||
//log.Printf("\n==> Pushing sequence batch\n")
|
||||
// start := time.Now()
|
||||
|
||||
iterator.Push(obiiter.MakeBioSequenceBatch(i, slice))
|
||||
@ -100,7 +101,7 @@ func ReadFastSeqBatchFromFile(filename string, options ...WithOption) (obiiter.I
|
||||
fi, err := os.Stat(filename)
|
||||
if err == nil {
|
||||
size = fi.Size()
|
||||
log.Printf("File size of %s is %d bytes\n", filename, size)
|
||||
log.Debugf("File size of %s is %d bytes\n", filename, size)
|
||||
} else {
|
||||
size = -1
|
||||
}
|
||||
@ -110,10 +111,10 @@ func ReadFastSeqBatchFromFile(filename string, options ...WithOption) (obiiter.I
|
||||
|
||||
go func() {
|
||||
newIter.WaitAndClose()
|
||||
log.Println("End of the fastq file reading")
|
||||
log.Debugln("End of the fastq file reading")
|
||||
}()
|
||||
|
||||
log.Println("Start of the fastq file reading")
|
||||
log.Debugln("Start of the fastq file reading")
|
||||
|
||||
go _FastseqReader(pointer, newIter, opt.BatchSize())
|
||||
parser := opt.ParseFastSeqHeader()
|
||||
|
@ -4,10 +4,11 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
@ -114,6 +115,7 @@ func WriteFastaBatch(iterator obiiter.IBioSequenceBatch,
|
||||
go func() {
|
||||
newIter.WaitAndClose()
|
||||
close(chunkchan)
|
||||
log.Debugln("End of the fasta file writing")
|
||||
}()
|
||||
|
||||
ff := func(iterator obiiter.IBioSequenceBatch) {
|
||||
@ -128,7 +130,7 @@ func WriteFastaBatch(iterator obiiter.IBioSequenceBatch,
|
||||
newIter.Done()
|
||||
}
|
||||
|
||||
log.Println("Start of the fasta file writing")
|
||||
log.Debugln("Start of the fasta file writing")
|
||||
go ff(iterator)
|
||||
for i := 0; i < nwriters-1; i++ {
|
||||
go ff(iterator.Split())
|
||||
|
@ -4,10 +4,11 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
)
|
||||
@ -114,6 +115,7 @@ func WriteFastqBatch(iterator obiiter.IBioSequenceBatch,
|
||||
time.Sleep(time.Millisecond)
|
||||
}
|
||||
close(chunkchan)
|
||||
log.Debugln("End of the fastq file writing")
|
||||
}()
|
||||
|
||||
ff := func(iterator obiiter.IBioSequenceBatch) {
|
||||
@ -129,7 +131,7 @@ func WriteFastqBatch(iterator obiiter.IBioSequenceBatch,
|
||||
newIter.Done()
|
||||
}
|
||||
|
||||
log.Println("Start of the fastq file writing")
|
||||
log.Debugln("Start of the fastq file writing")
|
||||
go ff(iterator)
|
||||
for i := 0; i < nwriters-1; i++ {
|
||||
go ff(iterator.Split())
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
"encoding/csv"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
|
@ -4,10 +4,11 @@ import (
|
||||
"bufio"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
)
|
||||
|
||||
@ -57,7 +58,7 @@ func ReadSequencesBatchFromFile(filename string,
|
||||
if err != nil {
|
||||
file.Seek(0, 0)
|
||||
} else {
|
||||
log.Printf("File %s is gz compressed ", filename)
|
||||
log.Debugf("File %s is gz compressed ", filename)
|
||||
reader = greader
|
||||
}
|
||||
|
||||
@ -72,7 +73,7 @@ func ReadSequencesBatchFromFile(filename string,
|
||||
}
|
||||
|
||||
filetype := GuessSeqFileType(string(tag))
|
||||
log.Printf("File guessed format : %s (tag: %s)",
|
||||
log.Debug("File guessed format : %s (tag: %s)",
|
||||
filetype, (strings.Split(string(tag), "\n"))[0])
|
||||
reader = breader
|
||||
|
||||
|
@ -3,7 +3,7 @@ package obiformats
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
|
Reference in New Issue
Block a user