Documentation ¶
Index ¶
- Constants
- Variables
- func Composite(text, level string, color bool) string
- func DEBUG(a ...interface{})
- func DEBUGC(fn func() string)
- func DEBUGF(format string, a ...interface{})
- func DirectionString(inbound bool) string
- func ERROR(a ...interface{})
- func ERRORC(fn func() string)
- func ERRORF(format string, a ...interface{})
- func FATAL(a ...interface{})
- func FATALC(fn func() string)
- func FATALF(format string, a ...interface{})
- func FileExists(filePath string) bool
- func INFO(a ...interface{})
- func INFOC(fn func() string)
- func INFOF(format string, a ...interface{})
- func PickNoun(n int, singular, plural string) string
- func Print(a ...interface{})
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func SPEW(a interface{})
- func SetLogWriter(w io.Writer)
- func TRACE(a ...interface{})
- func TRACEC(fn func() string)
- func TRACEF(format string, a ...interface{})
- func WARN(a ...interface{})
- func WARNC(fn func() string)
- func WARNF(format string, a ...interface{})
- type Entry
- type LogWriter
- type Logger
- type PrintcFunc
- type PrintfFunc
- type PrintlnFunc
- type SpewFunc
Constants ¶
View Source
const ( Off = "off" Fatal = "fatal" Error = "error" Warn = "warn" Info = "info" Debug = "debug" Trace = "trace" )
Variables ¶
View Source
var L = Empty()
View Source
var NoClosure = func() PrintcFunc { f := func(_ func() string) {} return &f }
View Source
var NoPrintf = func() PrintfFunc { f := func(_ string, _ ...interface{}) {} return &f }
View Source
var NoPrintln = func() PrintlnFunc {
f := func(_ ...interface{}) {}
return &f
}
View Source
var NoSpew = func() SpewFunc {
f := func(_ interface{}) {}
return &f
}
View Source
var StartupTime = time.Now()
Functions ¶
func DirectionString ¶
DirectionString is a helper function that returns a string that represents the direction of a connection (inbound or outbound).
func FileExists ¶
FileExists reports whether the named file or directory exists.
func SetLogWriter ¶
Types ¶
type Logger ¶
type Logger struct { Fatal PrintlnFunc Error PrintlnFunc Warn PrintlnFunc Info PrintlnFunc Debug PrintlnFunc Trace PrintlnFunc Traces SpewFunc Fatalf PrintfFunc Errorf PrintfFunc Warnf PrintfFunc Infof PrintfFunc Debugf PrintfFunc Tracef PrintfFunc Fatalc PrintcFunc Errorc PrintcFunc Warnc PrintcFunc Infoc PrintcFunc Debugc PrintcFunc Tracec PrintcFunc LogFileHandle *os.File Writer LogWriter Color bool // If this channel is loaded log entries are composed and sent to it LogChan chan Entry }
Logger is a struct containing all the functions with nice handy names
func (*Logger) SetLogPaths ¶
SetLogPaths sets a file path to write logs
type PrintcFunc ¶
type PrintcFunc *func(func() string)
type PrintfFunc ¶
type PrintfFunc *func(format string, a ...interface{})
type PrintlnFunc ¶
type PrintlnFunc *func(a ...interface{})
Click to show internal directories.
Click to hide internal directories.