Documentation ¶
Index ¶
- 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 ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger implements a variadic flavor of log/syslog.Writer
func New ¶
func New() Logger
New creates a new logger. syslog is tried first, if syslog fails Stdout is used.
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) 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.