Documentation ¶
Index ¶
- Variables
- func CaptureOutput(f func()) (stderr string, stdout string)
- func CondDebug(msg ...string)
- func CondDebugSet(val bool)
- func CondDebugStatus() bool
- func CondDebugln(msg ...string)
- func CurrentFunctionName() string
- func Debug(msg ...string)
- func Debugln(msg ...string)
- func ErrorExit(errorCode uint8, msg ...string)
- func ExecCmd(cmd string, args ...string) error
- func ExitIfError(err error, exitcode uint8, msg string)
- func LogErr(msg string)
- func LogInfo(msg string)
- func LogInit(tag string)
- func LogStringInit(tag string)
- func LogWarn(msg string)
Constants ¶
This section is empty.
Variables ¶
var OutputWriter io.Writer = os.Stderr
Functions ¶
func CaptureOutput ¶
CaptureOutput get a function as its argument. It executes the function and returns the output (stderr and stdout) created by this function. While capturing this output, this output is not written to default stdout or stderr.
func CondDebugSet ¶
func CondDebugSet(val bool)
CondDebugSet(val bool) allows us to turn debug on/off.
func CondDebugStatus ¶
func CondDebugStatus() bool
CondDebugStatus() allows to check if debug is turned on/off.
func CondDebugln ¶
func CondDebugln(msg ...string)
CondDebug() is the implementation of a global debug function. If it was turned on using CondDebugSet(true), then the string is shown to stderr. Else, no output is created.
func CurrentFunctionName ¶
func CurrentFunctionName() string
CurrentFunctionName() returns the name of the current function being executed.
func ExecCmd ¶ added in v1.4.0
execCmd is a helper to execute an external application. If the exit status of this command is non-zero, then an error is returned, else nil.
func ExitIfError ¶ added in v1.2.0
func LogErr ¶ added in v1.2.0
func LogErr(msg string)
LogErr creates a message preprended with ERROR to syslog and stderr, but tries to continue execution.
func LogInfo ¶ added in v1.2.0
func LogInfo(msg string)
LogInfo creates an info error message to syslog and STDERR.
func LogInit ¶ added in v1.2.0
func LogInit(tag string)
LogInit tries to initialise the logging service.
func LogStringInit ¶ added in v1.2.0
func LogStringInit(tag string)
LogStringInit does not use syslog (for dockerised environments. Instead, it writes all messages to stderr) This is suited for dockerised environments.
Types ¶
This section is empty.