log

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

log implements logging.

SPDX-License-Identifier: MIT Copyright (c) 2019 Hadrien Chauvin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Writer io.Writer
}

func (*Logger) Error

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

Info 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) Warning

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

Info logs a warning message for the given log domain.

Jump to

Keyboard shortcuts

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