You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
496 B
22 lines
496 B
package output
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitoa.ru/go-4devs/console/output/formatter"
|
|
"gitoa.ru/go-4devs/console/output/verbosity"
|
|
)
|
|
|
|
func Format(out Output, format *formatter.Formatter) Output {
|
|
return func(ctx context.Context, v verbosity.Verbosity, msg string, kv ...KeyValue) (int, error) {
|
|
return out(ctx, v, format.Format(ctx, msg), kv...)
|
|
}
|
|
}
|
|
|
|
func Ansi(out Output) Output {
|
|
return Format(out, formatter.Ansi())
|
|
}
|
|
|
|
func None(out Output) Output {
|
|
return Format(out, formatter.None())
|
|
}
|
|
|