Documentation ¶
Index ¶
- Variables
- type Logger
- func (log *Logger) Print(args ...interface{})
- func (log *Logger) Printf(format string, args ...interface{})
- func (log *Logger) Println(args ...interface{})
- func (log *Logger) SetColor(color *color.Color) *Logger
- func (log *Logger) SetNewLine(newline bool) *Logger
- func (log *Logger) SetOutput(output io.Writer) *Logger
- func (log *Logger) SetOutputToNil() *Logger
- func (log *Logger) SetOutputToStderr() *Logger
- func (log *Logger) SetOutputToStdout() *Logger
- func (log *Logger) SetPrefix(prefix func(string) string) *Logger
- func (log *Logger) SetSuffix(suffix func(string) string) *Logger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Error logger Error = New().SetNewLine(false).SetColor(color.New().SetFrontRed()).SetPrefix( func(s string) string { return color.New().SetFrontRed().SetFontBold().Colorful("ERROR ") }, ).SetOutputToStderr() // Info logger Info = New().SetNewLine(false).SetPrefix( func(s string) string { return color.New().SetFontBold().Colorful("INFO ") }, ).SetOutputToStdout() // Debug logger Debug = New().SetNewLine(false).SetColor(color.New().SetFrontYellow()).SetPrefix( func(s string) string { return color.New().SetFrontYellow().SetFontBold().Colorful("DEBUG ") }, ).SetOutputToStdout() )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger object
func (*Logger) Println ¶
func (log *Logger) Println(args ...interface{})
Println log something with newline
func (*Logger) SetNewLine ¶ added in v1.0.3
SetNewLine add a newline at the end of the log
func (*Logger) SetOutputToNil ¶
SetOutputToNil do not output
func (*Logger) SetOutputToStderr ¶
SetOutputToStderr output to stderr
func (*Logger) SetOutputToStdout ¶
SetOutputToStdout output to stdout
Click to show internal directories.
Click to hide internal directories.