Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ILogger ¶
type ILogger interface { Debug(v ...interface{}) Info(v ...interface{}) Warning(v ...interface{}) Error(v ...interface{}) Critical(v ...interface{}) Write(b []byte) (int, error) }
var Log ILogger = &logger{}
func FromContext ¶
func New ¶
func New(writer io.Writer, logLevel LogLevel, formatType LogFormatType, timeFmtTyp TimeFormatType) ILogger
type LogFormatType ¶
type LogFormatType string
const ( // FormatShort time:{{.Time}}\tlevel:{{.Level}}\tmessage:{{.Message}}\n FormatShort LogFormatType = "time:{{.Time}}\tlevel:{{.Level}}\tmessage:{{.Message}}\n" // FormatStandard time:{{.Time}}\tlevel:{{.Level}}\tfilename:{{.Filename}}:{{.LineNumber}}\tmessage:{{.Message}}\n FormatStandard LogFormatType = "time:{{.Time}}\tlevel:{{.Level}}\tfilename:{{.Filename}}:{{.LineNumber}}\tmessage:{{.Message}}\n" // FormatLong time:{{.Time}}\tlevel:{{.Level}}\tfilename:{{.Filename}}:{{.LineNumber}}\tfuncname:{{.Funcname}}\tmessage:{{.Message}}\n FormatLong LogFormatType = "time:{{.Time}}\tlevel:{{.Level}}\tfilename:{{.Filename}}:{{.LineNumber}}\tfuncname:{{.Funcname}}\tmessage:{{.Message}}\n" )
func ConvertLogFmt ¶
func ConvertLogFmt(fmt string) LogFormatType
func (LogFormatType) String ¶
func (f LogFormatType) String() string
type LogTemplate ¶
type TimeFormatType ¶
type TimeFormatType string
const ( // FormatDate 2006/01/02 FormatDate TimeFormatType = "2006/01/02" // FormatDatetime 2006/01/02 15:04:05 FormatDatetime TimeFormatType = "2006/01/02 15:04:05" // FormatMillisec 2006/01/02 15:04:05.000 FormatMillisec TimeFormatType = "2006/01/02 15:04:05.000" )
func ConvertTimeFmt ¶
func ConvertTimeFmt(fmt string) TimeFormatType
func (TimeFormatType) String ¶
func (t TimeFormatType) String() string
Click to show internal directories.
Click to hide internal directories.