1
0
mirror of https://github.com/restic/restic.git synced 2024-06-20 07:06:38 +02:00
restic/internal/ui/progress/printer.go

31 lines
772 B
Go
Raw Normal View History

package progress
// A Printer can can return a new counter or print messages
// at different log levels.
// It must be safe to call its methods from concurrent goroutines.
type Printer interface {
NewCounter(description string) *Counter
E(msg string, args ...interface{})
P(msg string, args ...interface{})
V(msg string, args ...interface{})
VV(msg string, args ...interface{})
}
// NoopPrinter discards all messages
type NoopPrinter struct{}
var _ Printer = (*NoopPrinter)(nil)
2024-01-20 21:58:28 +01:00
func (*NoopPrinter) NewCounter(_ string) *Counter {
return nil
}
2024-01-20 21:58:28 +01:00
func (*NoopPrinter) E(_ string, _ ...interface{}) {}
2024-01-20 21:58:28 +01:00
func (*NoopPrinter) P(_ string, _ ...interface{}) {}
2024-01-20 21:58:28 +01:00
func (*NoopPrinter) V(_ string, _ ...interface{}) {}
2024-01-20 21:58:28 +01:00
func (*NoopPrinter) VV(_ string, _ ...interface{}) {}