1
0
Fork 0

Adding upstream version 0.0~git20250409.f7acab6.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 11:36:18 +02:00
parent b9b5d88025
commit 21b930d007
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
51 changed files with 11229 additions and 0 deletions

38
console/std_printer.go Normal file
View file

@ -0,0 +1,38 @@
package console
import (
"log"
"os"
)
var (
stderrLogger = log.Default() // the default logger output to stderr
stdoutLogger = log.New(os.Stdout, "", log.LstdFlags)
defaultStdPrinter Printer = &StdPrinter{
StdoutPrint: func(s string) { stdoutLogger.Print(s) },
StderrPrint: func(s string) { stderrLogger.Print(s) },
}
)
// StdPrinter implements the console.Printer interface
// that prints to the stdout or stderr.
type StdPrinter struct {
StdoutPrint func(s string)
StderrPrint func(s string)
}
// Log prints s to the stdout.
func (p StdPrinter) Log(s string) {
p.StdoutPrint(s)
}
// Warn prints s to the stderr.
func (p StdPrinter) Warn(s string) {
p.StderrPrint(s)
}
// Error prints s to the stderr.
func (p StdPrinter) Error(s string) {
p.StderrPrint(s)
}