Documentation ¶
Index ¶
- Variables
- func AssertOk(err error, wrapMsg ...string)
- func AssertTrue(express bool, wrapMsg ...string)
- func Debgf(format string, a ...interface{})
- func Erro(err error, wrapMsg ...string)
- func Errof(format string, a ...interface{})
- func Fata(err error, wrapMsg ...string)
- func Fataf(format string, a ...interface{})
- func Infof(format string, a ...interface{})
- func Init(saveDisk bool)
- func SetClock(c gtime.Clock)
- func Warnf(format string, a ...interface{})
- type Config
- type DefaultImpl
- func (lgz *DefaultImpl) AssertOk(err error, wrapMsg ...string)
- func (lgz *DefaultImpl) AssertTrue(express bool, wrapMsg ...string)
- func (lgz *DefaultImpl) Debgf(format string, a ...interface{})
- func (lgz *DefaultImpl) Destroy()
- func (lgz *DefaultImpl) Erro(err error, wrapMsg ...string)
- func (lgz *DefaultImpl) Errof(format string, a ...interface{})
- func (lgz *DefaultImpl) Fata(err error, wrapMsg ...string)
- func (lgz *DefaultImpl) Fataf(format string, a ...interface{})
- func (lgz *DefaultImpl) Flush()
- func (lgz *DefaultImpl) Infof(format string, a ...interface{})
- func (lgz *DefaultImpl) Init(config *Config) error
- func (lgz *DefaultImpl) Logging(log LogItem) error
- func (lgz *DefaultImpl) LoggingEx(level Level, text string, tags map[string]string) error
- func (lgz *DefaultImpl) SetClock(c gtime.Clock)
- func (lgz *DefaultImpl) Warnf(format string, a ...interface{})
- func (lgz *DefaultImpl) WriteMsg(when time.Time, msg string, level Level) error
- type Interface
- type Level
- type LogItem
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogger = &DefaultImpl{}
Functions ¶
func AssertTrue ¶
Types ¶
type Config ¶
type Config struct { SaveDisk bool SaveDir string FileNameFormat string PrintScreen bool MachId string AppName string }
func DefaultConfig ¶
type DefaultImpl ¶
type DefaultImpl struct {
// contains filtered or unexported fields
}
func NewInsideLogger ¶
func NewInsideLogger(c gtime.Clock) *DefaultImpl
func (*DefaultImpl) AssertOk ¶
func (lgz *DefaultImpl) AssertOk(err error, wrapMsg ...string)
func (*DefaultImpl) AssertTrue ¶
func (lgz *DefaultImpl) AssertTrue(express bool, wrapMsg ...string)
func (*DefaultImpl) Debgf ¶
func (lgz *DefaultImpl) Debgf(format string, a ...interface{})
func (*DefaultImpl) Destroy ¶
func (lgz *DefaultImpl) Destroy()
func (*DefaultImpl) Erro ¶
func (lgz *DefaultImpl) Erro(err error, wrapMsg ...string)
func (*DefaultImpl) Errof ¶
func (lgz *DefaultImpl) Errof(format string, a ...interface{})
func (*DefaultImpl) Fata ¶
func (lgz *DefaultImpl) Fata(err error, wrapMsg ...string)
func (*DefaultImpl) Fataf ¶
func (lgz *DefaultImpl) Fataf(format string, a ...interface{})
func (*DefaultImpl) Flush ¶
func (lgz *DefaultImpl) Flush()
func (*DefaultImpl) Infof ¶
func (lgz *DefaultImpl) Infof(format string, a ...interface{})
func (*DefaultImpl) Init ¶
func (lgz *DefaultImpl) Init(config *Config) error
注意,这里的receiver必须用*DefaultImpl,不可以用logger,否则conf将无法保存进l里面去
func (*DefaultImpl) Logging ¶
func (lgz *DefaultImpl) Logging(log LogItem) error
func (*DefaultImpl) SetClock ¶
func (lgz *DefaultImpl) SetClock(c gtime.Clock)
func (*DefaultImpl) Warnf ¶
func (lgz *DefaultImpl) Warnf(format string, a ...interface{})
type Interface ¶
type Interface interface { Debgf(format string, a ...interface{}) Infof(format string, a ...interface{}) Warnf(format string, a ...interface{}) Errof(format string, a ...interface{}) Fataf(format string, a ...interface{}) Erro(err error, wrapMsg ...string) Fata(err error, wrapMsg ...string) AssertOk(err error, wrapMsg ...string) AssertTrue(express bool, wrapMsg ...string) }
Click to show internal directories.
Click to hide internal directories.