mirror of
https://github.com/asciinema/asciinema.git
synced 2025-12-16 11:48:13 +01:00
27 lines
534 B
Go
27 lines
534 B
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
"io/ioutil"
|
|
"os"
|
|
)
|
|
|
|
var loggerOutput io.Writer = os.Stdout
|
|
|
|
func BeQuiet() {
|
|
loggerOutput = ioutil.Discard
|
|
}
|
|
|
|
func Printf(s string, args ...interface{}) {
|
|
fmt.Fprintf(loggerOutput, "\x1b[32m~ %v\x1b[0m\n", fmt.Sprintf(s, args...))
|
|
}
|
|
|
|
func ReplaceWarningf(s string, args ...interface{}) {
|
|
fmt.Fprintf(loggerOutput, "\r\x1b[33m~ %v\x1b[0m", fmt.Sprintf(s, args...))
|
|
}
|
|
|
|
func Warningf(s string, args ...interface{}) {
|
|
fmt.Fprintf(loggerOutput, "\x1b[33m~ %v\x1b[0m\n", fmt.Sprintf(s, args...))
|
|
}
|