Documentation ¶
Index ¶
- func QuotedCmd(cmd *exec.Cmd) string
- type Logger
- func (l Logger) Alert(format string, a ...interface{}) error
- func (l Logger) Close()
- func (l Logger) Crit(format string, a ...interface{}) error
- func (l Logger) Debug(format string, a ...interface{}) error
- func (l Logger) Emerg(format string, a ...interface{}) error
- func (l Logger) Err(format string, a ...interface{}) error
- func (l Logger) Info(format string, a ...interface{}) error
- func (l *Logger) LogCmd(cmd *exec.Cmd, format string, a ...interface{}) (int, error)
- func (l *Logger) LogOp(op func() error, format string, a ...interface{}) error
- func (l Logger) Notice(format string, a ...interface{}) error
- func (l *Logger) PopPrefix()
- func (l *Logger) PushPrefix(format string, a ...interface{})
- func (l Logger) Warning(format string, a ...interface{}) error
- type LoggerOps
- type Stdout
- func (Stdout) Alert(msg string) error
- func (Stdout) Close() error
- func (Stdout) Crit(msg string) error
- func (Stdout) Debug(msg string) error
- func (Stdout) Emerg(msg string) error
- func (Stdout) Err(msg string) error
- func (Stdout) Info(msg string) error
- func (Stdout) Notice(msg string) error
- func (Stdout) Warning(msg string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements a variadic flavor of log/syslog.Writer
func New ¶
New creates a new logger. If logToStdout is true, syslog is tried first. If syslog fails or logToStdout is false Stdout is used.
func (Logger) Alert ¶
Alert logs a message at alert priority.
func (Logger) Crit ¶
Crit logs a message at critical priority.
func (Logger) Debug ¶
Debug logs a message at debug priority.
func (Logger) Emerg ¶
Emerg logs a message at emergency priority.
func (Logger) Err ¶
Err logs a message at error priority.
func (Logger) Info ¶
Info logs a message at info priority.
func (*Logger) LogCmd ¶
LogCmd runs and logs the supplied cmd as an operation with distinct start/finish/fail log messages uniformly combined with the supplied format string. The exact command path and arguments being executed are also logged for debugging assistance.
func (*Logger) LogOp ¶
LogOp calls and logs the supplied function as an operation with distinct start/finish/fail log messages uniformly combined with the supplied format string.
func (Logger) Notice ¶
Notice logs a message at notice priority.
func (*Logger) PopPrefix ¶
func (l *Logger) PopPrefix()
PopPrefix pops the top entry from the Logger's prefix stack. The prefix stack is concatenated in FIFO order and prefixed to the start of every message logged via Logger.
func (*Logger) PushPrefix ¶
PushPrefix pushes the supplied message onto the Logger's prefix stack. The prefix stack is concatenated in FIFO order and prefixed to the start of every message logged via Logger.
type LoggerOps ¶
type Stdout ¶
type Stdout struct{}