forked from TrueCloudLab/restic
backup: print scanner errors to stderr, not stdout
This commit is contained in:
parent
d2f7c5a9c6
commit
f4bdfea1c9
1 changed files with 8 additions and 4 deletions
|
@ -16,6 +16,7 @@ type TextProgress struct {
|
||||||
*ui.Message
|
*ui.Message
|
||||||
|
|
||||||
term *termstatus.Terminal
|
term *termstatus.Terminal
|
||||||
|
verbosity uint
|
||||||
}
|
}
|
||||||
|
|
||||||
// assert that Backup implements the ProgressPrinter interface
|
// assert that Backup implements the ProgressPrinter interface
|
||||||
|
@ -26,6 +27,7 @@ func NewTextProgress(term *termstatus.Terminal, verbosity uint) *TextProgress {
|
||||||
return &TextProgress{
|
return &TextProgress{
|
||||||
Message: ui.NewMessage(term, verbosity),
|
Message: ui.NewMessage(term, verbosity),
|
||||||
term: term,
|
term: term,
|
||||||
|
verbosity: verbosity,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +75,9 @@ func (b *TextProgress) Update(total, processed Counter, errors uint, currentFile
|
||||||
// ScannerError is the error callback function for the scanner, it prints the
|
// ScannerError is the error callback function for the scanner, it prints the
|
||||||
// error in verbose mode and returns nil.
|
// error in verbose mode and returns nil.
|
||||||
func (b *TextProgress) ScannerError(_ string, err error) error {
|
func (b *TextProgress) ScannerError(_ string, err error) error {
|
||||||
b.V("scan: %v\n", err)
|
if b.verbosity >= 2 {
|
||||||
|
b.E("scan: %v\n", err)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue