logging: Replace functions by native equivalents
This commit is contained in:
parent
4fc937841a
commit
d7847b5d69
10 changed files with 28 additions and 40 deletions
|
|
@ -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...)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue