Documentation
¶
Index ¶
- func Debug(logType string, data ...interface{})
- func Error(logType string, data ...interface{})
- func Info(logType string, data ...interface{})
- func LogRequest(...)
- func MakeLogTime(time time.Time) float64
- func MakeUesdTime(startTime, endTime time.Time) float32
- func ParseSpecialLog(from *BaseLog, to interface{}) error
- func SetLevel(level LevelType)
- func SetTruncations(truncations ...string)
- func SetWriter(writer func(string))
- func Warning(logType string, data ...interface{})
- type BaseLog
- type LevelType
- type Logger
- func (logger *Logger) Debug(logType string, data ...interface{})
- func (logger *Logger) Error(logType string, data ...interface{})
- func (logger *Logger) Info(logType string, data ...interface{})
- func (logger *Logger) LogRequest(...)
- func (logger *Logger) SetLevel(level LevelType)
- func (logger *Logger) SetTruncations(truncations ...string)
- func (logger *Logger) SetWriter(writer func(string))
- func (logger *Logger) Warning(logType string, data ...interface{})
- type RequestLog
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRequest ¶
func LogRequest(app, node, clientIp, fromApp, fromNode, clientId, sessionId, requestId, host, scheme, proto string, authLevel, priority int, method, path string, requestHeaders map[string]string, requestData map[string]interface{}, usedTime float32, responseCode int, responseHeaders map[string]string, responseDataLength uint, responseData interface{}, extraInfo map[string]interface{})
func MakeLogTime ¶ added in v0.0.3
func MakeUesdTime ¶ added in v0.0.3
func ParseSpecialLog ¶ added in v0.0.5
func SetTruncations ¶
func SetTruncations(truncations ...string)
Types ¶
type BaseLog ¶ added in v0.0.3
type BaseLog struct {
LogType string
LogTime time.Time
LogLevel string
Traces string
Extra map[string]interface{}
}
func ParseBadLog ¶ added in v0.0.5
func ParseBaseLog ¶ added in v0.0.5
type LevelType ¶
type LevelType int
const DEBUG LevelType = 1
const ERROR LevelType = 4
const INFO LevelType = 2
const WARNING LevelType = 3
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func (*Logger) LogRequest ¶
func (logger *Logger) LogRequest(app, node, clientIp, fromApp, fromNode, clientId, sessionId, requestId, host, scheme, proto string, authLevel, priority int, method, path string, requestHeaders map[string]string, requestData map[string]interface{}, usedTime float32, responseCode int, responseHeaders map[string]string, responseDataLength uint, responseData interface{}, extraInfo map[string]interface{})
func (*Logger) SetTruncations ¶
type RequestLog ¶ added in v0.0.3
type RequestLog struct {
BaseLog
App string
Node string
ClientIp string
FromApp string
FromNode string
ClientId string
SessionId string
RequestId string
Host string
Scheme string
Proto string
AuthLevel int
Priority int
Method string
Path string
RequestHeaders map[string]string
RequestData map[string]interface{}
UsedTime float32
ResponseCode int
ResponseHeaders map[string]string
ResponseDataLength uint
ResponseData interface{}
}
Click to show internal directories.
Click to hide internal directories.