send failed import lines to stdout for users to redirect to another log/import file

pull/3502/head
Cory LaNou 2015-08-03 14:00:19 -05:00
parent b29f9a4118
commit 96aaad4ffe
1 changed files with 2 additions and 0 deletions

View File

@ -171,6 +171,8 @@ func (i *Importer) batchAccumulator(line string) {
if len(i.batch) == batchSize {
if e := i.batchWrite(); e != nil {
log.Println("error writing batch: ", e)
// Output failed lines to STDOUT so users can capture lines that failed to import
fmt.Println(strings.Join(i.batch, "\n"))
i.failedInserts += len(i.batch)
} else {
i.totalInserts += len(i.batch)