debugErrorCE

package module
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputWriter io.Writer = os.Stderr

Functions

func CaptureOutput

func CaptureOutput(f func()) (stderr string, stdout string)

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 CondDebug

func CondDebug(msg ...string)

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 Debug

func Debug(msg ...string)

func Debugln

func Debugln(msg ...string)

func ErrorExit

func ErrorExit(errorCode uint8, msg ...string)

func ExecCmd added in v1.4.0

func ExecCmd(cmd string, args ...string) error

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 ExitIfError(err error, exitcode uint8, msg string)

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.

func LogWarn added in v1.2.0

func LogWarn(msg string)

LogWarn creates a syslog and STDERR message labeled with WARNING.

Types

This section is empty.

Jump to

Keyboard shortcuts

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