From 3b591ed9878a643b9ac7c84d2f0b37f44b036515 Mon Sep 17 00:00:00 2001 From: Alexander Weiss Date: Thu, 8 Oct 2020 23:01:24 +0200 Subject: [PATCH] Add Verboseff --- cmd/restic/global.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/restic/global.go b/cmd/restic/global.go index 33d222eea..0c95f9d52 100644 --- a/cmd/restic/global.go +++ b/cmd/restic/global.go @@ -231,6 +231,13 @@ func Verbosef(format string, args ...interface{}) { } } +// Verboseff calls Printf to write the message when the verbosity is >= 2 +func Verboseff(format string, args ...interface{}) { + if globalOptions.verbosity >= 2 { + Printf(format, args...) + } +} + // PrintProgress wraps fmt.Printf to handle the difference in writing progress // information to terminals and non-terminal stdout func PrintProgress(format string, args ...interface{}) {