output

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package output handles the output for Goophry. It provides routines to enable debug messages. Also output can be written to a logfile instead of printing it to stdout. Furthermore it provides the possibility to execute a command to notify an external script/application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

type Output struct {
	// contains filtered or unexported fields
}

An Output provides routines to handle messages within Goophry.

func NewOutput

func NewOutput() Output

NewOutput returns a new instance of Output, writing the messages to stdout per default.

func (Output) Debug

func (o Output) Debug(msg string)

Debug writes a message to the current output, when debugging output is enabled.

func (Output) NotifyError

func (o Output) NotifyError(msg string)

NotifyError executes the notify-command with a given message.

func (*Output) SetDebug

func (o *Output) SetDebug(d bool)

SetDebug enables/disables debugging output.

func (*Output) SetLogfile

func (o *Output) SetLogfile(path string) error

SetLogfile modifies the Output object to write messages to the given logfile instead of stdout. It may return an error, if something went wrong with opening the file.

func (*Output) SetNotifyCmd

func (o *Output) SetNotifyCmd(cmd string)

SetNotifyCmd sets the command used for notifying about certain messages.

func (Output) StopError

func (o Output) StopError(msg string)

StopError writes a message to the current output, executes the notify-command and exits Goophry with the status 1.

Jump to

Keyboard shortcuts

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