Documentation
¶
Index ¶
- Constants
- func AppendIp(correlationId string, instanceId string, ip string)
- func Debug(correlationId string, instanceId string, v ...interface{})
- func End(correlationId string, instanceId string)
- func Error(correlationId string, instanceId string, v ...interface{})
- func Info(correlationId string, instanceId string, v ...interface{})
- func Start(correlationId string, instanceId string) bool
- func StoreLog(level string, instanceId string, correlationId string, innerIp string, ...)
- func StoreLogAnsync(level string, instanceId string, correlationId string, innerIp string, ...)
- func StoreLogSync(level string, instanceId string, correlationId string, innerIp string, ...)
- func Warn(correlationId string, instanceId string, v ...interface{})
- type ConcurrentMap
- func (cm *ConcurrentMap) Get(k interface{}) interface{}
- func (cm *ConcurrentMap) KeyType() reflect.Type
- func (cm *ConcurrentMap) Put(k interface{}, v interface{}) (bool, error)
- func (cm *ConcurrentMap) Remove(k interface{})
- func (cm *ConcurrentMap) Size() int
- func (cm *ConcurrentMap) ValueType() reflect.Type
- type LogInfo
- type LogInfoRequest
- type Store
- func (store *Store) Debug(v ...interface{})
- func (store *Store) DeleteLog(instanceId string, correlation_id string) (result bool)
- func (store *Store) End() (result bool)
- func (store *Store) Error(v ...interface{})
- func (store *Store) Flush() (result bool)
- func (store *Store) Info(v ...interface{})
- func (store *Store) LogMessage(level string, v ...interface{}) (result bool)
- func (store *Store) QueryLogByCorrelationIdAndInstanceId(instanceId string, correlation_id string) (result *LogInfo)
- func (store *Store) QueryLogByInstanceId(instanceId string) (result *LogInfo)
- func (store *Store) Start(instanceId string, correlation_id string, ip string)
- func (store *Store) Warn(v ...interface{})
Constants ¶
View Source
const ( WarnLevel = "[Warn] " InfoLevel = "[Info] " DebugLevel = "[Debug] " ErrorLevel = "[Error] " )
View Source
const (
LOG_TABLE = "log"
)
Variables ¶
This section is empty.
Functions ¶
func StoreLog ¶
func StoreLog(level string, instanceId string, correlationId string, innerIp string, isSync bool, v ...interface{})
*
- 日志直接存储
func StoreLogAnsync ¶
func StoreLogAnsync(level string, instanceId string, correlationId string, innerIp string, v ...interface{})
*
- 日志异步存储
Types ¶
type ConcurrentMap ¶
type ConcurrentMap struct {
// contains filtered or unexported fields
}
func NewConcurrentMap ¶
func (*ConcurrentMap) Get ¶
func (cm *ConcurrentMap) Get(k interface{}) interface{}
func (*ConcurrentMap) KeyType ¶
func (cm *ConcurrentMap) KeyType() reflect.Type
func (*ConcurrentMap) Put ¶
func (cm *ConcurrentMap) Put(k interface{}, v interface{}) (bool, error)
func (*ConcurrentMap) Remove ¶
func (cm *ConcurrentMap) Remove(k interface{})
func (*ConcurrentMap) Size ¶
func (cm *ConcurrentMap) Size() int
func (*ConcurrentMap) ValueType ¶
func (cm *ConcurrentMap) ValueType() reflect.Type
type LogInfo ¶
type LogInfo struct { InstanceId string `json:"instance_id" orm:"pk"` CorrelationId string `json:"correlation_id"` Ip string `json:"ip"` //机器ip Message string `json:"message"` //日志信息 Mutex *sync.Mutex `json:"-" orm:"-"` //互斥锁 }
func NewDefaultLogInfo ¶
func NewLogInfo ¶
type LogInfoRequest ¶
type Store ¶
type Store struct {
LogInfo *LogInfo
}
func (*Store) LogMessage ¶
func (*Store) QueryLogByCorrelationIdAndInstanceId ¶
func (*Store) QueryLogByInstanceId ¶
Click to show internal directories.
Click to hide internal directories.