Documentation
¶
Index ¶
- Constants
- func SetOutput(out io.Writer)
- type Level
- 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) GetLevel() *Level
- func (l *Logger) Info(message ...interface{})
- func (l *Logger) Infof(format string, message ...interface{})
- func (l *Logger) New(name string, level *Level) *Logger
- func (l *Logger) Warn(message ...interface{})
- func (l *Logger) Warnf(format string, message ...interface{})
- type StandardLogger
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" DEBUG = 3 INFO = 2 WARN = 1 ERROR = 0 )
Define colors
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct { Level *Level // 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
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
type StandardLogger ¶
type StandardLogger struct {
// contains filtered or unexported fields
}
func NewStdLogger ¶
func NewStdLogger(out io.Writer) *StandardLogger
func (*StandardLogger) Output ¶
func (l *StandardLogger) Output(color, str string) error
Writes the specified string to std and colors it accordingly
Click to show internal directories.
Click to hide internal directories.