Documentation
¶
Index ¶
- func CreateBeegoLogger(opt *Options) *logs.BeeLogger
- func IfString()
- func InstallOptionsWatchDog(dog func(cc *Options))
- func Int2String(a int) string
- type BIMsg
- type BeegoLogger
- type ContextParam
- type LogMsg
- type Logger
- func (logger *Logger) BiReport(msg BIMsg)
- func (logger *Logger) Debugf(format string, a ...interface{})
- func (logger *Logger) Errorf(format string, a ...interface{})
- func (logger *Logger) Infof(format string, a ...interface{})
- func (logger *Logger) JDebug(msg LogMsg)
- func (logger *Logger) JError(msg LogMsg)
- func (logger *Logger) JInfo(msg LogMsg)
- func (logger *Logger) JWarn(msg LogMsg)
- func (logger *Logger) Warnf(format string, a ...interface{})
- type Option
- func WithDaily(v bool) Option
- func WithDebug(v bool) Option
- func WithFilename(v string) Option
- func WithLevel(v int) Option
- func WithMaxDays(v int) Option
- func WithMaxlines(v int) Option
- func WithMaxsize(v int) Option
- func WithPerm(v string) Option
- func WithRotate(v bool) Option
- func WithSeparate(v ...string) Option
- type Options
- type Trace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBeegoLogger ¶
func InstallOptionsWatchDog ¶
func InstallOptionsWatchDog(dog func(cc *Options))
func Int2String ¶
Types ¶
type BIMsg ¶
type BIMsg struct { EventId string //事件ID ProjectId string `json:"project_id" valid:"required"` //bi分配的项目组项目id ClientId string `json:"client_id" valid:"required"` //服务项目的clientid DeviceId string `json:"device_id" valid:"optional"` //用户的设备original_deviceid UserId string `json:"user_id" valid:"optional"` //用户id Type string `json:"type" valid:"required"` //ga事件类型。有game、coin、login、pay、push、track、profile ErrorCode string `json:"err_code" valid:"optional"` //错误码 如果正常事件 ErrorCode=0 ErrorMsg string `json:"err_msg" valid:"optional"` //错误信息 ErrorReport string //错误描述,由程序员书写,概述错误可能导 // 致的问题以及解决方案 Properties map[string]string `json:"properties" valid:"optional"` //事件的额外补充,必须是string:string格式的map Lib map[string]string `json:"lib" valid:"optional"` //服务器版本信息,也必须是string:string格式的map }
type BeegoLogger ¶
type BeegoLogger struct { Option *Options Trace *Trace Msg string Level wlog.Level // contains filtered or unexported fields }
func (*BeegoLogger) MustInstallGa ¶
func (bee *BeegoLogger) MustInstallGa(projectID, clientID string)
MustInstallGa Ga日志必选参数
type ContextParam ¶
type ContextParam struct { IP string `json:"ip"` UserAgent string `json:"user_agent"` Path string `json:"path"` Method string `json:"method"` Proto string `json:"proto"` Status int `json:"status"` AccessId string `json:"access_id"` SignType string `json:"sign_type"` SecretType string `json:"secret_type"` Random string `json:"random"` Timestamp string `json:"timestamp"` Signature string `json:"signature"` //session ServerId string `json:"server_id"` Topic string `json:"topic"` UserId string `json:"user_id"` SessionId string `json:"session_id"` ClientId string `json:"client_id" valid:"required"` //服务项目的clientid DeviceId string `json:"device_id" valid:"optional"` //用户的设备original_deviceid }
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger 日志对象
func CreateLogger ¶
func GetLoggerWithSession ¶ added in v1.0.3
GetLogger 获取 Logger 对象
func GetRootLogger ¶
func GetRootLogger() *Logger
type Option ¶
func WithFilename ¶
func WithMaxDays ¶
func WithMaxlines ¶
func WithMaxsize ¶
func WithRotate ¶
func WithSeparate ¶
type Options ¶
type Options struct { Filename string `json:"filename"` Maxlines int `json:"maxline"` Maxsize int `json:"maxsize"` Daily bool `json:"daily"` MaxDays int `json:"maxdays"` Rotate bool `json:"rotate"` Level int `json:"level"` Perm string `json:"perm"` Separate []string `json:"separate"` Debug bool }
func NewOptions ¶
func (*Options) ApplyOption ¶
func (*Options) GetSetOption ¶
type Trace ¶
type Trace struct {
*logs.BeegoTraceSpan
}
Click to show internal directories.
Click to hide internal directories.