Documentation ¶
Index ¶
- Variables
- func AddEverythingFromPattern(pattern string)
- func AddNothingExceptFilter(pattern string)
- func Color(colorString string) func(...interface{}) string
- func Debugf(format string, v ...interface{})
- func Debugln(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Errorln(v ...interface{})
- func ExcludeFromPattern(pattern string)
- func Infof(format string, v ...interface{})
- func Infoln(v ...interface{})
- func Printf(level Level, format string, v ...interface{})
- func Println(level Level, v ...interface{})
- func SetLevel(level Level)
- func SetStd(logger *Logger)
- func SetUseColor(useColor bool)
- func Warnf(format string, v ...interface{})
- func Warnln(v ...interface{})
- type Level
- type Logger
- func (l *Logger) AddEverythingFromPattern(pattern string)
- func (l *Logger) AddNothingExceptFilter(pattern string)
- func (l *Logger) ExcludeFromPattern(pattern string)
- func (l *Logger) Printf(level Level, format string, v ...interface{})
- func (l *Logger) Println(level Level, v ...interface{})
- func (l *Logger) SetLevel(level Level)
- func (l *Logger) SetUseColor(useColor bool)
Constants ¶
This section is empty.
Variables ¶
var ( Debug = Teal Info = Green Warn = Yellow Error = Red )
*** Color code from https://gist.github.com/ik5/d8ecde700972d4378d87 ***
var ( Black = Color("\033[1;30m%s\033[0m") Red = Color("\033[1;31m%s\033[0m") Green = Color("\033[1;32m%s\033[0m") Yellow = Color("\033[1;33m%s\033[0m") Purple = Color("\033[1;34m%s\033[0m") Magenta = Color("\033[1;35m%s\033[0m") Teal = Color("\033[1;36m%s\033[0m") White = Color("\033[1;37m%s\033[0m") )
Functions ¶
func AddEverythingFromPattern ¶
func AddEverythingFromPattern(pattern string)
AddEverythingFromPattern adds a pattern to skip log level filtering, guaranteeing all logs matching the pattern are seen
func AddNothingExceptFilter ¶
func AddNothingExceptFilter(pattern string)
AddNothingExceptFilter enables strong filtering showing logs only for things on the approved list, adding this pattern to the list
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf outputs the format and variables at the Debug level
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf outputs the format and variables at the Error level
func ExcludeFromPattern ¶
func ExcludeFromPattern(pattern string)
ExcludeFromPattern adds a pattern to exclude logs from
func Infof ¶
func Infof(format string, v ...interface{})
Infof outputs the format and variables at the Info level
func Println ¶
func Println(level Level, v ...interface{})
Println outputs the varibles assuming they pass the filter level
func SetLevel ¶
func SetLevel(level Level)
SetLevel changes the filtering level of the system logger
func SetUseColor ¶ added in v1.0.1
func SetUseColor(useColor bool)
SetUseColor toggles weather color output is used
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger is a go Logger wrapper that adds log levels and pattern filtering It allows high level 'log level' filtering broadly It allows allows two addition levels of filtering:
everythingFrom which allows inclusion of packages/patterns along with general logging nothingExcept which allows focusing on just listed areas
func NewFile ¶
NewFile returns a new Logger that logs to the supplied file with a filter set to the supplied level
func (*Logger) AddEverythingFromPattern ¶
AddEverythingFromPattern adds a pattern to skip log level filtering, guaranteeing all logs matching the pattern are seen
func (*Logger) AddNothingExceptFilter ¶
AddNothingExceptFilter enables strong filtering showing logs only for things on the approved list, adding this pattern to the list
func (*Logger) ExcludeFromPattern ¶
ExcludeFromPattern adds a pattern to exclude logs from
func (*Logger) Printf ¶
Printf outputs the format and variables, assuming it passes the filter levels
func (*Logger) SetUseColor ¶ added in v1.0.1
SetUseColor toggles weather color output is used