Documentation ¶
Index ¶
- Variables
- func ClientFilter() filter.ClientFilter
- func Debug(ctx context.Context, args ...interface{})
- func Debugf(ctx context.Context, format string, args ...interface{})
- func Error(ctx context.Context, args ...interface{})
- func Errorf(ctx context.Context, format string, args ...interface{})
- func Fatal(ctx context.Context, args ...interface{})
- func Fatalf(ctx context.Context, format string, args ...interface{})
- func Info(ctx context.Context, args ...interface{})
- func Infof(ctx context.Context, format string, args ...interface{})
- func LogRecoveryFilter(opts ...FilterOption) filter.ServerFilter
- func ServerFilter() filter.ServerFilter
- func Warn(ctx context.Context, args ...interface{})
- func Warnf(ctx context.Context, format string, args ...interface{})
- type Factory
- type FilterOption
- type FilterOptions
- type FlowKind
- type FlowLog
- type RecoveryHandler
- type Request
- type Response
- type Service
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultRecoveryHandler = handlePanic
DefaultRecoveryHandler default recovery
View Source
var ParseConfig = func(decoder *log.Decoder) (*config.Config, error) { cfg := &config.Config{ Addr: opentelemetry.DefaultExporterAddr, TenantID: opentelemetry.DefaultTenantID, Logs: config.LogsConfig{ Enabled: false, Level: opentelemetry.DefaultLogLevel, }, } if err := loadConfig(cfg); err != nil { return nil, err } if decoder.OutputConfig.Level != "" { var s logtps.Level err := s.UnmarshalText([]byte(decoder.OutputConfig.Level)) if err != nil { return nil, errors.New("opentelemetry level invalid: " + decoder.OutputConfig.Level) } cfg.Logs.Level = s } if cfg.Logs.Addr != "" { cfg.Addr = cfg.Logs.Addr } return cfg, nil }
ParseConfig parse config from decoder
Functions ¶
func LogRecoveryFilter ¶
func LogRecoveryFilter(opts ...FilterOption) filter.ServerFilter
LogRecoveryFilter log recovery filter
Types ¶
type Factory ¶
type Factory struct { }
Factory logger factory framework read config and init log
type FlowKind ¶
const ( FlowKindServer FlowKind = FlowKind(trace.SpanKindServer) FlowKindClient FlowKind = FlowKind(trace.SpanKindClient) )
func (FlowKind) MarshalJSON ¶
MarshalJSON return byte slice of flowkind
type FlowLog ¶
type FlowLog struct { Kind FlowKind `json:"kind,omitempty"` Source Service `json:"source,omitempty"` Target Service `json:"target,omitempty"` Request Request `json:"request,omitempty"` Response Response `json:"response,omitempty"` Cost string `json:"cost,omitempty"` Status Status `json:"status,omitempty"` }
FlowLog log model for rpc
type RecoveryHandler ¶
RecoveryHandler recovery
Click to show internal directories.
Click to hide internal directories.