Documentation
¶
Index ¶
- Constants
- Variables
- func Debug(message string, v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(message string, v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(message string, v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Info(message string, v ...interface{})
- func Infof(format string, v ...interface{})
- func New(raw *log.Logger, env string, level int, timezone, timeFormat string, ...) *logger
- func Notice(message string, v ...interface{})
- func Noticef(format string, v ...interface{})
- func Panic(message string, v ...interface{})
- func Panicf(format string, v ...interface{})
- func SetLevel(level int)
- func SetRequest(request *http.Request)
- func SetTrace(trace string)
- func Trace(skip, deep int) []string
- func Warn(message string, v ...interface{})
- func Warnf(format string, v ...interface{})
- type FeishuAlert
- func (f *FeishuAlert) Add(name string, option Option)
- func (f *FeishuAlert) AddMap(name string, setting map[string]interface{})
- func (f *FeishuAlert) AddMapBatch(batch map[string]interface{})
- func (f *FeishuAlert) FindOption(levelName string, entry, defaultName string) string
- func (f *FeishuAlert) Format(log LogEntry, kibanaUrl, esIndex string) string
- func (f *FeishuAlert) Send(log LogEntry)
- type LogEntry
- type Option
Constants ¶
View Source
const ( DEBUG = 100 INFO = 200 NOTICE = 250 WARN = 300 ERROR = 400 PANIC = 500 FATAL = 600 )
Variables ¶
View Source
var (
Logger = New(log.New(os.Stderr, "", log.Lmsgprefix), "local", DEBUG, "asia/shanghai", datetime.LayoutDateTimeZoneT, nil)
)
Functions ¶
Types ¶
type FeishuAlert ¶ added in v1.0.84
type FeishuAlert struct {
// contains filtered or unexported fields
}
var Feishu *FeishuAlert
func NewFeishu ¶ added in v1.0.84
func NewFeishu(options map[string]interface{}) *FeishuAlert
func (*FeishuAlert) Add ¶ added in v1.0.84
func (f *FeishuAlert) Add(name string, option Option)
func (*FeishuAlert) AddMap ¶ added in v1.0.84
func (f *FeishuAlert) AddMap(name string, setting map[string]interface{})
func (*FeishuAlert) AddMapBatch ¶ added in v1.0.84
func (f *FeishuAlert) AddMapBatch(batch map[string]interface{})
func (*FeishuAlert) FindOption ¶ added in v1.0.84
func (f *FeishuAlert) FindOption(levelName string, entry, defaultName string) string
func (*FeishuAlert) Format ¶ added in v1.0.84
func (f *FeishuAlert) Format(log LogEntry, kibanaUrl, esIndex string) string
func (*FeishuAlert) Send ¶ added in v1.0.84
func (f *FeishuAlert) Send(log LogEntry)
type LogEntry ¶ added in v1.0.82
type LogEntry struct { Datetime string `json:"datetime"` Env string `json:"env"` Channel string `json:"channel"` Level int `json:"level"` LevelName string `json:"level_name"` Trace string `json:"trace"` IP string `json:"ip"` Command string `json:"command"` Message string `json:"message"` Context string `json:"context"` Memory uint64 `json:"memory"` Method string `json:"method"` URL string `json:"url"` UserAgent string `json:"ua"` Referer string `json:"referer"` Extra interface{} `json:"extra,omitempty"` }
Click to show internal directories.
Click to hide internal directories.