Documentation ¶
Index ¶
- Constants
- func Error(msg string, keysAndValues ...interface{})
- func Info(msg string, keysAndValues ...interface{})
- func Initialize() error
- func InitializeLoki() error
- func Warn(msg string, keysAndValues ...interface{})
- type Loger
- func (l *Loger) Clone() *Loger
- func (l *Loger) Error(msg string, keysAndValues ...interface{})
- func (l *Loger) Info(msg string, keysAndValues ...interface{})
- func (l *Loger) Warn(msg string, keysAndValues ...interface{})
- func (l *Loger) WithArg(args ...interface{}) *Loger
- func (l *Loger) WithContext(ctx context.Context) *Loger
- func (l *Loger) WithLabel(k string, v interface{}) *Loger
- func (l *Loger) WithLabelMap(args map[string]interface{}) *Loger
- type LokiWriter
Constants ¶
View Source
const ( LableKeyTraceId = "trace_id" LableKeySpanId = "span_id" LableKeyReqId = "req_id" )
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize() error
func InitializeLoki ¶
func InitializeLoki() error
Types ¶
type Loger ¶
type Loger struct {
// contains filtered or unexported fields
}
Loger 日志记录器 labels 用于记录日志的标签 args 用于记录日志的参数 msg (arg)k=(arg)v
func GetLoger ¶
func GetLoger() *Loger
func WithContext(ctx context.Context) *Loger { return GetLoger().WithContext(ctx) }
func WithContext ¶
func WithLabelMap ¶
func (*Loger) WithLabelMap ¶
type LokiWriter ¶
func (*LokiWriter) Levels ¶
func (rcv *LokiWriter) Levels() []logrus.Level
Click to show internal directories.
Click to hide internal directories.