Documentation ¶
Index ¶
- Constants
- Variables
- func Backtrace(size int) []string
- func Darwin() bool
- func Debug(args ...interface{})
- func Debugf(msg string, args ...interface{})
- func Error(msg string, err error, stack []byte)
- func FileExists(path string) (bool, error)
- func Info(args ...interface{})
- func Infof(msg string, args ...interface{})
- func InitLogger(level string)
- func Nows() string
- func ParseTime(str string) (time.Time, error)
- func RandomJid() string
- func ReadLines(data []byte) ([]string, error)
- func Thens(tim time.Time) string
- func Warn(args ...interface{})
- func Warnf(msg string, args ...interface{})
- type Logger
Constants ¶
View Source
const ( // This is the canonical timestamp format used by Faktory. // Always UTC, lexigraphically sortable. This is the best // timestamp format, accept no others. TimestampFormat = time.RFC3339Nano )
Variables ¶
View Source
var ( LogInfo = false LogDebug = false )
Functions ¶
func Debug ¶
func Debug(args ...interface{})
-l debug: Verbosity level which helps track down production issues
func Debugf ¶
func Debugf(msg string, args ...interface{})
-l debug: Verbosity level which helps track down production issues
func FileExists ¶
func InitLogger ¶
func InitLogger(level string)
Types ¶
type Logger ¶
type Logger interface { Debug(args ...interface{}) Debugf(format string, args ...interface{}) Info(args ...interface{}) Infof(format string, args ...interface{}) Warn(args ...interface{}) Warnf(format string, args ...interface{}) Error(args ...interface{}) Errorf(format string, args ...interface{}) // Log and terminate process (unrecoverable) Fatal(args ...interface{}) // Log with fmt.Printf-like formatting and terminate process (unrecoverable) Fatalf(format string, args ...interface{}) // Log and panic (recoverable) Panic(args ...interface{}) // Log with fmt.Printf-like formatting, then panic (recoverable) Panicf(format string, args ...interface{}) // Set key/value context for further logging with the returned logger WithField(key string, value interface{}) Logger // Set key/value context for further logging with the returned logger WithFields(keyValues map[string]interface{}) Logger // Return a logger with the specified error set, to be included in a subsequent normal logging call WithError(err error) Logger }
This generic logging interface hide a Logrus logger or another impl
Click to show internal directories.
Click to hide internal directories.