Documentation
¶
Index ¶
- Constants
- type Logger
- func (l *Logger) Debug(message ...interface{})
- func (l *Logger) Debugf(format string, message ...interface{})
- func (l *Logger) Error(message ...interface{})
- func (l *Logger) Errorf(format string, message ...interface{})
- func (l *Logger) Info(message ...interface{})
- func (l *Logger) Infof(format string, message ...interface{})
- func (l *Logger) Out(str string) error
- func (l *Logger) Output(color, level, str string) (n int, err error)
- func (l *Logger) Panic(message ...interface{})
- func (l *Logger) Panicf(format string, message ...interface{})
- func (l *Logger) Panicln(message ...interface{})
- func (l *Logger) Print(message ...interface{})
- func (l *Logger) Printf(format string, message ...interface{})
- func (l *Logger) Println(message ...interface{})
- func (l *Logger) SetLevel(level int) *Logger
- func (l *Logger) Warn(message ...interface{})
- func (l *Logger) Warnf(format string, message ...interface{})
Constants ¶
View Source
const ( CLR_0 = "\x1b[30;1m" CLR_R = "\x1b[31;1m" CLR_G = "\x1b[32;1m" CLR_Y = "\x1b[33;1m" CLR_B = "\x1b[34;1m" CLR_M = "\x1b[35;1m" CLR_C = "\x1b[36;1m" CLR_W = "\x1b[37;1m" CLR_N = "\x1b[0m" )
View Source
const ( DEBUG = 3 INFO = 2 WARN = 1 ERROR = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { Name string Level int TimeFormat string PrintTime bool PrintName bool PrintLevel bool UseColors bool // contains filtered or unexported fields }
func (*Logger) Debug ¶
func (l *Logger) Debug(message ...interface{})
Prints a debug message on a new line
func (*Logger) Debugf ¶
Prints according to fmt.Sprintf format specifier and returns the resulting string
func (*Logger) Error ¶
func (l *Logger) Error(message ...interface{})
Prints an error message on a new line followed by Exit
func (*Logger) Errorf ¶
Prints according to fmt.Sprintf format specifier and returns the resulting string
func (*Logger) Info ¶
func (l *Logger) Info(message ...interface{})
Prints n info message on a new line
func (*Logger) Infof ¶
Prints according to fmt.Sprintf format specifier and returns the resulting string
func (*Logger) Output ¶ added in v1.1.0
Writes the specified string to std and colors it accordingly
func (*Logger) Panic ¶ added in v1.1.0
func (l *Logger) Panic(message ...interface{})
Same as fmt.Sprint followed by panic
func (*Logger) Panicln ¶ added in v1.1.0
func (l *Logger) Panicln(message ...interface{})
Same as fmt.Sprintln followed by panic
func (*Logger) Print ¶ added in v1.1.0
func (l *Logger) Print(message ...interface{})
Same as fmt.Sprint
func (*Logger) Println ¶ added in v1.1.0
func (l *Logger) Println(message ...interface{})
Same as fmt.Sprintln
Click to show internal directories.
Click to hide internal directories.