Documentation ¶
Overview ¶
Package log is a logger used by Abot core and plugins. It standardizes logging formats consistent with Abot's needs, allowing for a debug mode, and enabling plugins to specify their own name so each plugin's logs are easy to isolate.
Index ¶
- func Debug(v ...interface{})
- func DebugPrefix(s string)
- func Debugf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetDebug(b bool)
- type Logger
- func (l *Logger) Debug(v ...interface{})
- func (l *Logger) Debugf(format string, v ...interface{})
- func (l *Logger) Error(v ...interface{})
- func (l *Logger) Errorf(format string, v ...interface{})
- func (l *Logger) Fatal(v ...interface{})
- func (l *Logger) Fatalf(format string, v ...interface{})
- func (l *Logger) Info(v ...interface{})
- func (l *Logger) Infof(format string, v ...interface{})
- func (l *Logger) SetDebug(b bool)
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) Warn(v ...interface{})
- func (l *Logger) Warnf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...interface{})
Debug logs a statement with the debug prefix if SetDebug(true) has been called and ends with a new line.
func DebugPrefix ¶
func DebugPrefix(s string)
DebugPrefix overrides the default "DEBUG: " prefix for debug logs.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs a statement with the debug prefix if SetDebug(true) has been called, allowing for custom formatting.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf logs a statement and kills the running process, allowing for custom formatting.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is defined for plugins to use in place of the stdlib log. It sets a prefix of the plugin name with each log and follows the convention of.
func (*Logger) Debug ¶
func (l *Logger) Debug(v ...interface{})
Debug logs a statement with the debug prefix if SetDebug(true) has been called and ends with a new line.
func (*Logger) Debugf ¶
Debugf logs a statement with the debug prefix if SetDebug(true) has been called, allowing for custom formatting.
func (*Logger) Error ¶
func (l *Logger) Error(v ...interface{})
Error is not used, but it's included to satisfy the Echo router's Logger interface. The rationale on why Warn and Error have been excluded can be found here: http://dave.cheney.net/2015/11/05/lets-talk-about-logging
func (*Logger) Errorf ¶
Errorf is not used, but it's included to satisfy the Echo router's Logger interface. The rationale on why Warn and Error have been excluded can be found here: http://dave.cheney.net/2015/11/05/lets-talk-about-logging
func (*Logger) Fatal ¶
func (l *Logger) Fatal(v ...interface{})
Fatal logs a statement and kills the running process.
func (*Logger) Fatalf ¶
Fatalf logs a statement and kills the running process, allowing for custom formatting.
func (*Logger) Info ¶
func (l *Logger) Info(v ...interface{})
Info logs a statement and ends with a new line.
func (*Logger) SetFlags ¶
SetFlags enables customizing flags just like the standard library's log.SetFlags.
func (*Logger) Warn ¶
func (l *Logger) Warn(v ...interface{})
Warn is not used, but it's included to satisfy the Echo router's Logger interface. The rationale on why Warn and Error have been excluded can be found here: http://dave.cheney.net/2015/11/05/lets-talk-about-logging
func (*Logger) Warnf ¶
Warnf is not used, but it's included to satisfy the Echo router's Logger interface. The rationale on why Warn and Error have been excluded can be found here: http://dave.cheney.net/2015/11/05/lets-talk-about-logging