Documentation ¶
Index ¶
- Constants
- type Logger
- func (l *Logger) Debug(message string)
- func (l *Logger) Error(message string)
- func (l *Logger) Fatal(message string)
- func (l *Logger) GetDebugPrefix() string
- func (l *Logger) GetErrorPrefix() string
- func (l *Logger) GetFatalPrefix() string
- func (l *Logger) GetInfoPrefix() string
- func (l Logger) GetLogLevel() int
- func (l *Logger) GetWarnPrefix() string
- func (l *Logger) Info(message string)
- func (l *Logger) ParseLevel(level string) error
- func (l *Logger) SetDebugPrefix(prefix string)
- func (l *Logger) SetErrorPrefix(prefix string)
- func (l *Logger) SetFatalPrefix(prefix string)
- func (l *Logger) SetInfoPrefix(prefix string)
- func (l *Logger) SetOutputFileDescriptor(output io.Writer)
- func (l *Logger) SetPrefixBorders(first, last string)
- func (l *Logger) SetTimeBorders(first, last string)
- func (l *Logger) SetTimeFormat(format string)
- func (l *Logger) SetWarnPrefix(prefix string)
- func (l *Logger) UseColors(value bool)
- func (l *Logger) Warn(message string)
Constants ¶
const ( DebugLvl = iota InfoLvl WarnLvl ErrorLvl FatalLvl )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLogger ¶
func NewLogger() *Logger
NewLogger creates a new logger object with default values set
func (*Logger) GetDebugPrefix ¶
GetDebugPrefix returns the debug prefix string
func (*Logger) GetErrorPrefix ¶
GetErrorPrefix returns the error prefix string
func (*Logger) GetFatalPrefix ¶
GetFatalPrefix returns the fatal prefix string
func (*Logger) GetInfoPrefix ¶
GetInfoPrefix returns the info prefix string
func (Logger) GetLogLevel ¶
GetLogLevel returns the logger's current log level
func (*Logger) GetWarnPrefix ¶
GetWarnPrefix returns the warn prefix string
func (*Logger) ParseLevel ¶
ParseLevel reads from a string an tries to set the logger's level according to the value provided. It returns an error if it can not parse the level
func (*Logger) SetDebugPrefix ¶
SetDebugPrefix sets the debug prefix string to prefix
func (*Logger) SetErrorPrefix ¶
SetErrorPrefix sets the error prefix string to prefix
func (*Logger) SetFatalPrefix ¶
SetFatalPrefix sets the fatal prefix string to prefix
func (*Logger) SetInfoPrefix ¶
SetInfoPrefix sets the info prefix string to prefix
func (*Logger) SetOutputFileDescriptor ¶
SetOutputFileDescriptor allows the user to choose the fd that will be used to log
func (*Logger) SetPrefixBorders ¶
SetPrefixBorders allows to set the level prefix borders
func (*Logger) SetTimeBorders ¶ added in v0.0.2
SetTimeBorders allows an user to set the time prefix borders
func (*Logger) SetTimeFormat ¶ added in v0.0.2
SetTimeFormat allows an user to change default time format
func (*Logger) SetWarnPrefix ¶
SetWarnPrefix sets the warn prefix string to prefix