Documentation ¶
Index ¶
Constants ¶
const ( VerbositySilent = iota VerbosityDefault VerbosityVerbose )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*option)
Option configures log output options.
func CustomVerbose ¶
CustomVerbose changes the log output to be prefixed with a custom label.
func Silent ¶
func Silent() Option
Silent creates a log output that doesn't print any of the written lines.
func WithStderr ¶
func WithStderr(r io.WriteCloser) Option
WithStderr sets a custom writer to use instead of the default `os.Stderr`.
func WithStdout ¶
func WithStdout(r io.WriteCloser) Option
WithStdout sets a custom writer to use instead of the default `os.Stdout`.
type Output ¶
type Output struct {
// contains filtered or unexported fields
}
Output stores writers for standard output and error.
func NewOutput ¶
NewOutput creates a new log output. By default, the new output uses the default OS stdout and stderr to initialize the outputs with a default verbosity that doesn't change the output.
func (Output) Stderr ¶
func (o Output) Stderr() io.WriteCloser
Stderr returns the standard error writer.
func (Output) Stdout ¶
func (o Output) Stdout() io.WriteCloser
Stdout returns the standard output writer.