Documentation ¶
Index ¶
- func Debug(i ...interface{})
- func Debugf(f string, i ...interface{})
- func Error(i ...interface{})
- func Errorf(f string, i ...interface{})
- func Fatal(exit func(int), i ...interface{})
- func Fatalf(exit func(int), f string, i ...interface{})
- func GetHTMLOutput() io.Writer
- func GetHTMLStatus() bool
- func Info(i ...interface{})
- func Infof(f string, i ...interface{})
- func SetFormat(format string)
- func SetHTMLOutput(out io.Writer)
- func SetHTMLStatus(status bool, addr string)
- func SetOutput(out io.Writer)
- func SetTimeFormat(format string)
- func Warn(i ...interface{})
- func Warnf(f string, i ...interface{})
- type Color
- type Format
- type IColor
- type IFormat
- type IStringGetSetter
- type IStringGetter
- type IStringSetter
- type ITag
- type ITier
- type ITimeFormat
- type Logger
- type StringGetSetter
- type Tag
- type Tier
- func (t *Tier) Dup() ITier
- func (t *Tier) GetColor() IColor
- func (t *Tier) GetFormat() IFormat
- func (t *Tier) GetTag() ITag
- func (t *Tier) GetTimeFormat() ITimeFormat
- func (t *Tier) GetWriter() io.Writer
- func (t *Tier) Log(msgs ...interface{})
- func (t *Tier) Logf(format string, params ...interface{})
- func (t *Tier) SetColor(c IColor)
- func (t *Tier) SetFormat(format IFormat)
- func (t *Tier) SetTag(tag ITag)
- func (t *Tier) SetTimeFormat(timeFormat ITimeFormat)
- func (t *Tier) SetWriter(writer io.Writer)
- type TimeFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(i ...interface{})
Debug prints to output values i joined with a space. Will add the assigned Debug tag and color.
func Debugf ¶
func Debugf(f string, i ...interface{})
Debugf prints to output f formatted with values i. Uses the go standard library style format strings. Will add the assigned Debug tag and color.
func Error ¶
func Error(i ...interface{})
Error prints to output values i joined with a space. Will add the assigned Error tag and color.
func Errorf ¶
func Errorf(f string, i ...interface{})
Errorf prints to output f formatted with values i. Uses the go standard library style format strings. Will add the assigned Error tag and color.
func Fatal ¶
func Fatal(exit func(int), i ...interface{})
Fatal prints to output values i joined with a space. Will add the assigned Fatal tag and color.
func Fatalf ¶
Fatalf prints to output f formatted with values i. Uses the go standard library style format strings. Will add the assigned Fatal tag and color.
func GetHTMLOutput ¶
func GetHTMLStatus ¶
func GetHTMLStatus() bool
func Info ¶
func Info(i ...interface{})
Info prints to output values i joined with a space. Will add the assigned Info tag and color.
func Infof ¶
func Infof(f string, i ...interface{})
Infof prints to output f formatted with values i. Uses the go standard library style format strings. Will add the assigned Info tag and color.
func SetFormat ¶
func SetFormat(format string)
SetFormat will set the logger to format all output. The format string MUST have a {TIME}, {TAG}, {MSG} string inside. For example: `{TIME} [{TAG}]:> {MSG}` will print logs of the form `10-21-1975 13:24:56 ERROR:> this is the message` Be careful, this will just do nothing if the format is invalid.
func SetHTMLOutput ¶
SetHTMLOutput sets where the logger will write to
func SetHTMLStatus ¶
func SetTimeFormat ¶
func SetTimeFormat(format string)
SetTimeFormat sets the time format for the time stamp on a log line Uses the go standard library timeformat format.
Types ¶
type Format ¶
type Format struct {
StringGetSetter
}
Format struct holds the format of log messages. The Format string MUST have a {TIME}, {TAG}, {MSG} string inside. For example: `{TIME} [{TAG}]:> {MSG}` will print logs of the form `10-21-1975 13:24:56 ERROR:> this is the message`
type IFormat ¶
type IFormat interface { IStringGetSetter Dup() IFormat }
type IStringGetSetter ¶
type IStringGetSetter interface { IStringGetter IStringSetter }
type IStringGetter ¶
type IStringGetter interface {
Get() string
}
type IStringSetter ¶
type IStringSetter interface {
Set(string)
}
type ITag ¶
type ITag interface { IStringGetSetter Dup() ITag }
type ITier ¶
type ITier interface { GetColor() IColor SetColor(IColor) GetTag() ITag SetTag(ITag) GetFormat() IFormat SetFormat(IFormat) GetTimeFormat() ITimeFormat SetTimeFormat(ITimeFormat) GetWriter() io.Writer SetWriter(io.Writer) Dup() ITier Log(msg ...interface{}) Logf(format string, params ...interface{}) }
type ITimeFormat ¶
type ITimeFormat interface { IStringGetSetter Dup() ITimeFormat }
func NewTimeFormat ¶
func NewTimeFormat(format string) ITimeFormat
NewTimeFormat creates a new TimeFormat
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) Get ¶
Get will get the tier at index idx, it will return nil if the index is out of bounds.
func (*Logger) SetFormat ¶
SetFormat will set the logger to format all output. The format string MUST have a {TIME}, {TAG}, {MSG} string inside. For example: `{TIME} [{TAG}]:> {MSG}` will print logs of the form `10-21-1975 13:24:56 ERROR:> this is the message` Be careful, this will just do nothing if the format is invalid.
func (*Logger) SetTimeFormat ¶
SetTimeFormat sets the time format for the time stamp on a log line Uses the go standard library timeformat format.
type StringGetSetter ¶
type StringGetSetter struct {
// contains filtered or unexported fields
}
StringGetSetter is the base type for Color, Tag, Format, and TimeFormat
func (*StringGetSetter) Get ¶
func (s *StringGetSetter) Get() string
Get will return the string (thread safe)
func (*StringGetSetter) Set ¶
func (s *StringGetSetter) Set(str string)
Set will set the string (thread safe)
type Tier ¶
type Tier struct {
// contains filtered or unexported fields
}
Tier holds the properties for a logger tier.
func (*Tier) GetTimeFormat ¶
func (t *Tier) GetTimeFormat() ITimeFormat
GetTimeFormat gets the time format property
func (*Tier) SetTimeFormat ¶
func (t *Tier) SetTimeFormat(timeFormat ITimeFormat)
SetTimeFormat sets the time format property
type TimeFormat ¶
type TimeFormat struct {
StringGetSetter
}
TimeFormat is the type used for formatting the time. Uses the same time format as the go standard library "time." example `Mon Jan _2 15:04:05 2006`