log

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package log implements logging.

Index

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) Error

func (l *Logger) Error(domain string, message string, args ...interface{})

Error logs an error message for the given log domain.

func (*Logger) Info

func (l *Logger) Info(domain string, message string, args ...interface{})

Info logs an info message for the given log domain.

func (*Logger) Pipe

func (l *Logger) Pipe(domain string, cmd *exec.Cmd)

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

func (l *Logger) PipeReader(domain string, r io.Reader)

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

func (l *Logger) SetInteractive(int bool)

SetInteractive turns the logger into an interactive logger. In interactive mode, the cursor can move in the console terminal.

func (*Logger) Warning

func (l *Logger) Warning(domain string, message string, args ...interface{})

Warning logs a warning message for the given log domain.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL