Documentation
¶
Index ¶
- Constants
- Variables
- func Composite(text, level string, color bool, split string) string
- func DirectionString(inbound bool) string
- func FileExists(filePath string) bool
- func PickNoun(n int, singular, plural string) string
- func Print(a ...interface{})
- func Printf(format string, a ...interface{})
- func Println(a ...interface{})
- func SetLogWriter(w io.Writer)
- type CheckFunc
- 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" Check = "check" Debug = "debug" Trace = "trace" )
Variables ¶
View Source
var ( // NoClosure is a noop for a closure print function NoClosure = func() PrintcFunc { f := func(_ func() string) {} return f } // NoPrintf is a noop for a closure printf function NoPrintf = func() PrintfFunc { f := func(_ string, _ ...interface{}) {} return f } // NoPrintln is a noop for a println function NoPrintln = func() PrintlnFunc { f := func(_ ...interface{}) {} return f } // NoPrintln is a noop for a println function NoCheck = func() CheckFunc { f := func(_ error) bool { return true } return f } // NoSpew is a noop for a spew function NoSpew = func() SpewFunc { f := func(_ interface{}) {} return f } // StartupTime allows a shorter log prefix as time since start StartupTime = time.Now() BackgroundGrey = "\u001b[48;5;240m" ColorBlue = "\u001b[38;5;33m" ColorBold = "\u001b[1m" ColorBrown = "\u001b[38;5;130m" ColorCyan = "\u001b[36m" ColorFaint = "\u001b[2m" ColorGreen = "\u001b[38;5;40m" ColorItalic = "\u001b[3m" ColorOff = "\u001b[0m" ColorOrange = "\u001b[38;5;208m" ColorPurple = "\u001b[38;5;99m" ColorRed = "\u001b[38;5;196m" ColorUnderline = "\u001b[4m" ColorViolet = "\u001b[38;5;201m" ColorYellow = "\u001b[38;5;226m" )
View Source
var L = Empty()
Functions ¶
func DirectionString ¶
printlnFunc prints a log entry like Println
func FileExists ¶
sanitizeLoglevel accepts a string and returns a default if the input is not in the Levels slice
func SetLogWriter ¶
Types ¶
type LogWriter ¶
type Logger ¶
type Logger struct { Fatal PrintlnFunc Error PrintlnFunc Warn PrintlnFunc Info PrintlnFunc Check CheckFunc Debug PrintlnFunc Trace PrintlnFunc Fatalf PrintfFunc Errorf PrintfFunc Warnf PrintfFunc Infof PrintfFunc Checkf CheckFunc Debugf PrintfFunc Tracef PrintfFunc Fatalc PrintcFunc Errorc PrintcFunc Warnc PrintcFunc Infoc PrintcFunc Checkc CheckFunc Debugc PrintcFunc Tracec PrintcFunc Fatals SpewFunc Errors SpewFunc Warns SpewFunc Infos SpewFunc Debugs SpewFunc Traces SpewFunc LogFileHandle *os.File Writer LogWriter Color bool Split string // If this channel is loaded log entries are composed and sent to it LogChan chan Entry }
func Empty ¶
func Empty() *Logger
PickNoun returns the singular or plural form of a noun depending on the count n.
func (*Logger) SetLogPaths ¶
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.