Documentation ¶
Overview ¶
Package util contains util helper functions used by servers which protoc-gen-grpc-gateway generates.
Index ¶
- Variables
- func BufferWriteString(args ...string) string
- func CalPage(total uint64, pageSize int) int
- func Flush()
- func LogColorErrorf(logger *glog.Logger, format string, args ...interface{})
- func LogColorInfof(logger *glog.Logger, format string, args ...interface{})
- func Logef(logger *glog.Logger, format string, args ...interface{})
- func Logf(logger *glog.Logger, format string, args ...interface{})
- func MsStamp() int64
- func Sha1(b []byte) string
- func VLogef(logger *glog.Logger, level int32, format string, args ...interface{})
- func VLogf(logger *glog.Logger, level int32, format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ease-gateway 请求和响应详情日志. 支持格式包括: // 1. RequestRestFormat // 2. ResponseRestFormat RestLogger = glog.Context(nil, glog.FileName{Name: "gateway-rest"}) // request rest log format. // [request]traceId,serviceName,httpMethod,path,{reqInfo} // external {reqInfo}: source,client,appVersion,u:uid,c:cid,a:aid,d:did,remoteAddr,url // ldap {reqInfo}: remoteAddr,url RequestRestFormat = "[request]%s,%s,%s,%s,%s" // response rest log format. // [response]traceId,code,msg ResponseRestFormat = "[response]%s,%d,%s" )
gateway-rest日志
View Source
var ( // ease-gateway 访问统计日志. 支持格式包括: // 1. StatFormat StatLogger = glog.Context(nil, glog.FileName{Name: "gateway-stat"}) // stat log format. // traceId,serviceName,httpMethod,path,client,ok:isSuccess,code,ms:response-ms StatFormat = "%s,%s,%s,%s,%s,ok:%s,%d,ms:%g" )
gateway-stat日志
View Source
var ( // gateway错误日志. ErrorLogger = glog.Context(nil, glog.FileName{Name: "gateway-error"}) // error log format. ErrorFormat = "%s,%s" )
gateway-error日志
View Source
var ( // gateway限流日志. LimitLogger = glog.Context(nil, glog.FileName{Name: "gateway-limit"}) // traceId[limit type]service,httpMethod,path,limitInfo. LimitFormat = "%s[%s]%s,%s,%s,%s" )
gateway-limit日志
View Source
var ( // gateway默认日志文件, 排除上面的剩下的日志. DefaultLogger = glog.Context(nil, glog.FileName{Name: "gateway-default"}) // default log format. DefaultFormat = "%s,%s" )
gateway-default日志
View Source
var ( // ease-gateway 配置操作相关日志. ConfigLogger = glog.Context(nil, glog.FileName{Name: "gateway-config"}) )
gateway-config日志
Functions ¶
func BufferWriteString ¶
BufferWriteString method used to splice newline string
func LogColorErrorf ¶
LogColorErrorf logs in colored format for ErrorLogger.
func LogColorInfof ¶
LogColorInfof logs in colored format for RestLogger/ConfigLogger/StatLogger/ DefaultLogger.
func Logf ¶
Logf is used to record format logs for RestLogger/ConfigLogger/ StatLogger/DefaultLogger.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.