logging: Replace functions by native equivalents

This commit is contained in:
Tom Wiesing 2023-03-13 13:19:32 +01:00
parent 4fc937841a
commit d7847b5d69
No known key found for this signature in database
10 changed files with 28 additions and 40 deletions

View file

@ -18,16 +18,6 @@ func LogOperation(operation func() error, progress io.Writer, ctx context.Contex
return operation()
}
// Progress writes a progress message to the given progress writer.
func Progress(progress io.Writer, ctx context.Context, message string) {
io.WriteString(progress, message)
}
// ProgressF is like progress, but uses fmt.Sprintf()
func ProgressF(progress io.Writer, ctx context.Context, format string, args ...interface{}) {
Progress(progress, ctx, fmt.Sprintf(format, args...))
}
// LogMessage logs a message that is displayed to the user
func LogMessage(progress io.Writer, ctx context.Context, format string, args ...interface{}) (int, error) {
return logOperation(progress, ctx, getIndent(progress), format, args...)