Documentation ¶
Overview ¶
Package log implements logging.
Index ¶
- type Logger
- func (l *Logger) Error(domain string, message string, args ...interface{})
- func (l *Logger) Info(domain string, message string, args ...interface{})
- func (l *Logger) Pipe(domain string, cmd *exec.Cmd)
- func (l *Logger) PipeReader(domain string, r io.Reader)
- func (l *Logger) SetInteractive(int bool)
- func (l *Logger) Warning(domain string, message string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { // Writer is the writer to write the logs to. Writer io.Writer // contains filtered or unexported fields }
Logger parameterizes logging.
func (*Logger) Pipe ¶
Pipe logs the stdin and stdout of a process. The combined output is split by line, and each line is logged as an info message for the given log domain.
In the context of a CLI, this prefixes every line of output with the log domain, and helps readability when the outputs are multiplexed.
func (*Logger) PipeReader ¶
PipeReader logs the lines scanned from a reader. Each line is logged as an info message for the given log domain.
In the context of a CLI, this prefixes every line of output with the log domain, and helps readability when the outputs are multiplexed.
func (*Logger) SetInteractive ¶ added in v0.1.0
SetInteractive turns the logger into an interactive logger. In interactive mode, the cursor can move in the console terminal.