Documentation ¶
Index ¶
Constants ¶
View Source
const LogId w.Key = "id"
Variables ¶
This section is empty.
Functions ¶
func StreamInterceptor ¶
func StreamInterceptor(log grpclog.LoggerV2) grpc.StreamServerInterceptor
StreamInterceptor will use the log param to log the request duration. It also adds the request's id to the context
func UnaryInterceptor ¶
func UnaryInterceptor(log grpclog.LoggerV2) grpc.UnaryServerInterceptor
UnaryInterceptor will use the log param to log the request duration. It also adds the request's id to the context
Types ¶
type LogrusLogger ¶
LogrusLogger implements the V method of the grpclog for the *logrus.Entry
Example
log := logrus.StandardLogger() log.SetLevel(logrus.DebugLevel) log.SetFormatter( &logrus.TextFormatter{ ForceColors: true, DisableColors: false, TimestampFormat: "2006-01-02 15:04:05", FullTimestamp: true, QuoteEmptyFields: true, PadLevelText: true, }, ) grpclog.SetLoggerV2(&log.LogrusLogger{l})
func (*LogrusLogger) V ¶
func (s *LogrusLogger) V(l int) bool
V returns the result of current level == l
Click to show internal directories.
Click to hide internal directories.