Documentation
¶
Overview ¶
Package logger manage a colored concurrent safe logger to substitute golang log package. This implementation is heavely base on github.com/fatih/color package (for all the coloring stuff).
Index ¶
- type LogFacility
- func (f *LogFacility) CriticalLog(fmt string, arg ...interface{}) (int, error)
- func (f *LogFacility) ErrorLog(fmt string, arg ...interface{}) (int, error)
- func (f *LogFacility) MessageLog(fmt string, arg ...interface{}) (int, error)
- func (f *LogFacility) VerboseLog(fmt string, arg ...interface{}) (int, error)
- func (f *LogFacility) WarningLog(fmt string, arg ...interface{}) (int, error)
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogFacility ¶
type LogFacility struct {
// contains filtered or unexported fields
}
LogFacility logging facility structure.
func NewLogFacility ¶
func NewLogFacility(prefix string, timestamp bool, colored bool) *LogFacility
NewLogFacility creates a new logging facility to manage differently colored logs. If a prefix is specified it'll be added to each logging message, a time stamp can be also printed on screen.
func (*LogFacility) CriticalLog ¶
func (f *LogFacility) CriticalLog(fmt string, arg ...interface{}) (int, error)
CriticalLog prints critical logs using red color and bold font.
func (*LogFacility) ErrorLog ¶
func (f *LogFacility) ErrorLog(fmt string, arg ...interface{}) (int, error)
ErrorLog prints errors using red color.
func (*LogFacility) MessageLog ¶
func (f *LogFacility) MessageLog(fmt string, arg ...interface{}) (int, error)
MessageLog generic green logs.
func (*LogFacility) VerboseLog ¶
func (f *LogFacility) VerboseLog(fmt string, arg ...interface{}) (int, error)
VerboseLog print white verbose logs.
func (*LogFacility) WarningLog ¶
func (f *LogFacility) WarningLog(fmt string, arg ...interface{}) (int, error)
WarningLog prints warnings using yellow color.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger single colored logger structure.