Compare commits
26 Commits
v3.8.1
...
654f42f4b1
Author | SHA1 | Date | |
---|---|---|---|
654f42f4b1 | |||
eac258fa4a | |||
164938c793 | |||
0879aaf24b | |||
3555b3dcc0 | |||
c64f678946 | |||
1e43c401e6 | |||
3702299203 | |||
00f589590d | |||
|
28007e846e | ||
|
aa455ece7d | ||
|
2de6de4944 | ||
|
7bd9f097b7 | ||
|
0791bff0ea | ||
9c189df378 | |||
|
70ad1c7871 | ||
dbd6eb1889 | |||
|
8a893dd1a7 | ||
01b3c3cf15 | |||
|
abf8219c36 | ||
ebcfcfc753 | |||
|
f479ea8937 | ||
7533c3f6f2 | |||
|
04d20adebc | ||
308979d29c | |||
|
eb035fbfb5 |
10
go.mod
10
go.mod
@@ -4,11 +4,11 @@ go 1.16
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.3.0
|
||||
go.unistack.org/micro-proto/v3 v3.2.7 // indirect
|
||||
go.unistack.org/micro/v3 v3.8.21
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 // indirect
|
||||
google.golang.org/grpc v1.45.0
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d // indirect
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 // indirect
|
||||
google.golang.org/grpc v1.44.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
)
|
||||
|
25
go.sum
25
go.sum
@@ -45,7 +45,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/gnostic v0.6.6 h1:MVSM2r2j9aRUvYNym66JGW96Ddd5MN4sTi59yktb6yk=
|
||||
github.com/google/gnostic v0.6.6/go.mod h1:Nm8234We1lq6iB9OmlgNv3nH91XLLVZHCDayfA3xq+E=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
@@ -80,8 +79,6 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.unistack.org/micro-proto/v3 v3.2.1 h1:z7+V97LcAwMbBiYStmf8b6fFk2UPJTzni+rxNqk4NrI=
|
||||
go.unistack.org/micro-proto/v3 v3.2.1/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM=
|
||||
go.unistack.org/micro-proto/v3 v3.2.7 h1:zG6d69kHc+oij2lwQ3AfrCgdjiEVRG2A7TlsxjusWs4=
|
||||
go.unistack.org/micro-proto/v3 v3.2.7/go.mod h1:ZltVWNECD5yK+40+OCONzGw4OtmSdTpVi8/KFgo9dqM=
|
||||
go.unistack.org/micro/v3 v3.8.21 h1:8vYxtIlPnCBZ888BrQSP6+b0CFQcn5FiaqDpI5XqorQ=
|
||||
go.unistack.org/micro/v3 v3.8.21/go.mod h1:aBOCQ6SkAwKMRI7Q1CIsQA2S88ibyJfweJZlT1M2qpE=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
@@ -99,10 +96,9 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b h1:eB48h3HiRycXNy8E0Gf5e0hv7YT6Kt14L/D73G1fuwo=
|
||||
golang.org/x/net v0.0.0-20210928044308-7d9f5e0b762b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
|
||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d h1:1n1fc535VhN8SYtD4cDUyNlfpAF2ROMM9+11equK3hs=
|
||||
golang.org/x/net v0.0.0-20220114011407-0dd24b26b47d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -116,18 +112,13 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5 h1:y/woIyUBFbpQGKS0u1aHF/40WUDnek3fPOyD08H5Vng=
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0=
|
||||
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
@@ -145,10 +136,9 @@ google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoA
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368 h1:Et6SkiuvnBn+SgrSYXs/BrUpGB4mbdwt4R3vaPIlicA=
|
||||
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6 h1:FglFEfyj61zP3c6LgjmVHxYxZWXYul9oiS1EZqD5gLc=
|
||||
google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5 h1:zzNejm+EgrbLfDZ6lu9Uud2IVvHySPl8vQzf04laR5Q=
|
||||
google.golang.org/genproto v0.0.0-20220118154757-00ab72f36ad5/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
@@ -158,8 +148,6 @@ google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG
|
||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=
|
||||
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M=
|
||||
google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -180,7 +168,6 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
@@ -22,9 +22,9 @@ func NewLoggerServiceEndpoints() []api.Endpoint {
|
||||
}
|
||||
|
||||
type LoggerServiceClient interface {
|
||||
Log(ctx context.Context, req *proto.LogReq, opts ...client.CallOption) (*proto.LogRsp, error)
|
||||
Log(ctx context.Context, req *proto.Message, opts ...client.CallOption) (*proto.Empty, error)
|
||||
}
|
||||
|
||||
type LoggerServiceServer interface {
|
||||
Log(ctx context.Context, req *proto.LogReq, rsp *proto.LogRsp) error
|
||||
Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ func NewLoggerServiceClient(name string, c client.Client) LoggerServiceClient {
|
||||
return &loggerServiceClient{c: c, name: name}
|
||||
}
|
||||
|
||||
func (c *loggerServiceClient) Log(ctx context.Context, req *proto.LogReq, opts ...client.CallOption) (*proto.LogRsp, error) {
|
||||
rsp := &proto.LogRsp{}
|
||||
func (c *loggerServiceClient) Log(ctx context.Context, req *proto.Message, opts ...client.CallOption) (*proto.Empty, error) {
|
||||
rsp := &proto.Empty{}
|
||||
err := c.c.Call(ctx, c.c.NewRequest(c.name, "LoggerService.Log", req), rsp, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -34,13 +34,13 @@ type loggerServiceServer struct {
|
||||
LoggerServiceServer
|
||||
}
|
||||
|
||||
func (h *loggerServiceServer) Log(ctx context.Context, req *proto.LogReq, rsp *proto.LogRsp) error {
|
||||
func (h *loggerServiceServer) Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error {
|
||||
return h.LoggerServiceServer.Log(ctx, req, rsp)
|
||||
}
|
||||
|
||||
func RegisterLoggerServiceServer(s server.Server, sh LoggerServiceServer, opts ...server.HandlerOption) error {
|
||||
type loggerService interface {
|
||||
Log(ctx context.Context, req *proto.LogReq, rsp *proto.LogRsp) error
|
||||
Log(ctx context.Context, req *proto.Message, rsp *proto.Empty) error
|
||||
}
|
||||
type LoggerService struct {
|
||||
loggerService
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.26.0
|
||||
// protoc v3.19.4
|
||||
// protoc v3.17.3
|
||||
// source: service.proto
|
||||
|
||||
package servicepb
|
||||
@@ -20,14 +20,14 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type LogRsp struct {
|
||||
type Empty struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *LogRsp) Reset() {
|
||||
*x = LogRsp{}
|
||||
func (x *Empty) Reset() {
|
||||
*x = Empty{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -35,13 +35,13 @@ func (x *LogRsp) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LogRsp) String() string {
|
||||
func (x *Empty) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LogRsp) ProtoMessage() {}
|
||||
func (*Empty) ProtoMessage() {}
|
||||
|
||||
func (x *LogRsp) ProtoReflect() protoreflect.Message {
|
||||
func (x *Empty) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -53,12 +53,12 @@ func (x *LogRsp) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LogRsp.ProtoReflect.Descriptor instead.
|
||||
func (*LogRsp) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
|
||||
func (*Empty) Descriptor() ([]byte, []int) {
|
||||
return file_service_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
type LogReq struct {
|
||||
type Message struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
@@ -69,8 +69,8 @@ type LogReq struct {
|
||||
Fields []*Field `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
|
||||
}
|
||||
|
||||
func (x *LogReq) Reset() {
|
||||
*x = LogReq{}
|
||||
func (x *Message) Reset() {
|
||||
*x = Message{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -78,13 +78,13 @@ func (x *LogReq) Reset() {
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LogReq) String() string {
|
||||
func (x *Message) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*LogReq) ProtoMessage() {}
|
||||
func (*Message) ProtoMessage() {}
|
||||
|
||||
func (x *LogReq) ProtoReflect() protoreflect.Message {
|
||||
func (x *Message) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_service_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
@@ -96,33 +96,33 @@ func (x *LogReq) ProtoReflect() protoreflect.Message {
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use LogReq.ProtoReflect.Descriptor instead.
|
||||
func (*LogReq) Descriptor() ([]byte, []int) {
|
||||
// Deprecated: Use Message.ProtoReflect.Descriptor instead.
|
||||
func (*Message) Descriptor() ([]byte, []int) {
|
||||
return file_service_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *LogReq) GetLevel() int32 {
|
||||
func (x *Message) GetLevel() int32 {
|
||||
if x != nil {
|
||||
return x.Level
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *LogReq) GetFormat() string {
|
||||
func (x *Message) GetFormat() string {
|
||||
if x != nil {
|
||||
return x.Format
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogReq) GetMsg() string {
|
||||
func (x *Message) GetMsg() string {
|
||||
if x != nil {
|
||||
return x.Msg
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *LogReq) GetFields() []*Field {
|
||||
func (x *Message) GetFields() []*Field {
|
||||
if x != nil {
|
||||
return x.Fields
|
||||
}
|
||||
@@ -135,7 +135,12 @@ type Field struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
||||
Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"`
|
||||
// Types that are assignable to Val:
|
||||
// *Field_DoubleVal
|
||||
// *Field_FloatVal
|
||||
// *Field_Int32Val
|
||||
// *Field_Int64Val
|
||||
Val isField_Val `protobuf_oneof:"val"`
|
||||
}
|
||||
|
||||
func (x *Field) Reset() {
|
||||
@@ -177,37 +182,101 @@ func (x *Field) GetKey() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Field) GetVal() string {
|
||||
if x != nil {
|
||||
return x.Val
|
||||
func (m *Field) GetVal() isField_Val {
|
||||
if m != nil {
|
||||
return m.Val
|
||||
}
|
||||
return ""
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Field) GetDoubleVal() float64 {
|
||||
if x, ok := x.GetVal().(*Field_DoubleVal); ok {
|
||||
return x.DoubleVal
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Field) GetFloatVal() float32 {
|
||||
if x, ok := x.GetVal().(*Field_FloatVal); ok {
|
||||
return x.FloatVal
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Field) GetInt32Val() int32 {
|
||||
if x, ok := x.GetVal().(*Field_Int32Val); ok {
|
||||
return x.Int32Val
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Field) GetInt64Val() int64 {
|
||||
if x, ok := x.GetVal().(*Field_Int64Val); ok {
|
||||
return x.Int64Val
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
type isField_Val interface {
|
||||
isField_Val()
|
||||
}
|
||||
|
||||
type Field_DoubleVal struct {
|
||||
// https://developers.google.com/protocol-buffers/docs/proto3#scalar
|
||||
DoubleVal float64 `protobuf:"fixed64,2,opt,name=double_val,json=doubleVal,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Field_FloatVal struct {
|
||||
FloatVal float32 `protobuf:"fixed32,3,opt,name=float_val,json=floatVal,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Field_Int32Val struct {
|
||||
Int32Val int32 `protobuf:"varint,4,opt,name=int32_val,json=int32Val,proto3,oneof"`
|
||||
}
|
||||
|
||||
type Field_Int64Val struct {
|
||||
Int64Val int64 `protobuf:"varint,5,opt,name=int64_val,json=int64Val,proto3,oneof"` //1
|
||||
}
|
||||
|
||||
func (*Field_DoubleVal) isField_Val() {}
|
||||
|
||||
func (*Field_FloatVal) isField_Val() {}
|
||||
|
||||
func (*Field_Int32Val) isField_Val() {}
|
||||
|
||||
func (*Field_Int64Val) isField_Val() {}
|
||||
|
||||
var File_service_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_service_proto_rawDesc = []byte{
|
||||
0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x22, 0x08, 0x0a, 0x06, 0x4c, 0x6f,
|
||||
0x67, 0x52, 0x73, 0x70, 0x22, 0x72, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x12, 0x14,
|
||||
0x09, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d,
|
||||
0x70, 0x74, 0x79, 0x22, 0x73, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14,
|
||||
0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c,
|
||||
0x65, 0x76, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x28,
|
||||
0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
|
||||
0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,
|
||||
0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x2b, 0x0a, 0x05, 0x46, 0x69, 0x65, 0x6c,
|
||||
0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
|
||||
0x6b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
|
||||
0x52, 0x03, 0x76, 0x61, 0x6c, 0x32, 0x3e, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x53,
|
||||
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x03, 0x4c, 0x6f, 0x67, 0x12, 0x11, 0x2e,
|
||||
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71,
|
||||
0x1a, 0x11, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67,
|
||||
0x52, 0x73, 0x70, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x73,
|
||||
0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x2d, 0x6c,
|
||||
0x6f, 0x67, 0x67, 0x65, 0x72, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x76, 0x33,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x9e, 0x01, 0x0a, 0x05, 0x46, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x03, 0x6b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0a, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76,
|
||||
0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x09, 0x64, 0x6f, 0x75, 0x62,
|
||||
0x6c, 0x65, 0x56, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x5f, 0x76,
|
||||
0x61, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x48, 0x00, 0x52, 0x08, 0x66, 0x6c, 0x6f, 0x61,
|
||||
0x74, 0x56, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x5f, 0x76, 0x61,
|
||||
0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x33, 0x32,
|
||||
0x56, 0x61, 0x6c, 0x12, 0x1d, 0x0a, 0x09, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c,
|
||||
0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x08, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x56,
|
||||
0x61, 0x6c, 0x42, 0x05, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x32, 0x3e, 0x0a, 0x0d, 0x4c, 0x6f, 0x67,
|
||||
0x67, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x2d, 0x0a, 0x03, 0x4c, 0x6f,
|
||||
0x67, 0x12, 0x12, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70, 0x62, 0x2e, 0x4d, 0x65,
|
||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x1a, 0x10, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x70,
|
||||
0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x6f, 0x2e,
|
||||
0x75, 0x6e, 0x69, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6d, 0x69, 0x63,
|
||||
0x72, 0x6f, 0x2d, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||
0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3b, 0x73, 0x65, 0x72, 0x76, 0x69,
|
||||
0x63, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -224,14 +293,14 @@ func file_service_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_service_proto_goTypes = []interface{}{
|
||||
(*LogRsp)(nil), // 0: servicepb.LogRsp
|
||||
(*LogReq)(nil), // 1: servicepb.LogReq
|
||||
(*Field)(nil), // 2: servicepb.Field
|
||||
(*Empty)(nil), // 0: servicepb.Empty
|
||||
(*Message)(nil), // 1: servicepb.Message
|
||||
(*Field)(nil), // 2: servicepb.Field
|
||||
}
|
||||
var file_service_proto_depIdxs = []int32{
|
||||
2, // 0: servicepb.LogReq.fields:type_name -> servicepb.Field
|
||||
1, // 1: servicepb.LoggerService.Log:input_type -> servicepb.LogReq
|
||||
0, // 2: servicepb.LoggerService.Log:output_type -> servicepb.LogRsp
|
||||
2, // 0: servicepb.Message.fields:type_name -> servicepb.Field
|
||||
1, // 1: servicepb.LoggerService.Log:input_type -> servicepb.Message
|
||||
0, // 2: servicepb.LoggerService.Log:output_type -> servicepb.Empty
|
||||
2, // [2:3] is the sub-list for method output_type
|
||||
1, // [1:2] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
@@ -246,7 +315,7 @@ func file_service_proto_init() {
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LogRsp); i {
|
||||
switch v := v.(*Empty); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -258,7 +327,7 @@ func file_service_proto_init() {
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LogReq); i {
|
||||
switch v := v.(*Message); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
@@ -282,6 +351,12 @@ func file_service_proto_init() {
|
||||
}
|
||||
}
|
||||
}
|
||||
file_service_proto_msgTypes[2].OneofWrappers = []interface{}{
|
||||
(*Field_DoubleVal)(nil),
|
||||
(*Field_FloatVal)(nil),
|
||||
(*Field_Int32Val)(nil),
|
||||
(*Field_Int64Val)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
@@ -4,12 +4,12 @@ package servicepb;
|
||||
option go_package="go.unistack.org/micro-logger-service/v3/proto;servicepb";
|
||||
|
||||
service LoggerService {
|
||||
rpc Log(LogReq) returns (LogRsp) {};
|
||||
rpc Log(Message) returns (Empty) {};
|
||||
}
|
||||
|
||||
message LogRsp {};
|
||||
message Empty {};
|
||||
|
||||
message LogReq {
|
||||
message Message {
|
||||
int32 level = 1;
|
||||
string format = 2;
|
||||
string msg = 3;
|
||||
@@ -18,5 +18,12 @@ message LogReq {
|
||||
|
||||
message Field {
|
||||
string key = 1;
|
||||
string val = 2;
|
||||
oneof val {
|
||||
// https://developers.google.com/protocol-buffers/docs/proto3#scalar
|
||||
double double_val = 2;
|
||||
float float_val = 3;
|
||||
int32 int32_val = 4;
|
||||
int64 int64_val = 5;
|
||||
//1
|
||||
};
|
||||
};
|
||||
|
@@ -1,8 +1,4 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.19.4
|
||||
// source: service.proto
|
||||
|
||||
package servicepb
|
||||
|
||||
@@ -22,7 +18,7 @@ const _ = grpc.SupportPackageIsVersion7
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type LoggerServiceClient interface {
|
||||
Log(ctx context.Context, in *LogReq, opts ...grpc.CallOption) (*LogRsp, error)
|
||||
Log(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error)
|
||||
}
|
||||
|
||||
type loggerServiceClient struct {
|
||||
@@ -33,8 +29,8 @@ func NewLoggerServiceClient(cc grpc.ClientConnInterface) LoggerServiceClient {
|
||||
return &loggerServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *loggerServiceClient) Log(ctx context.Context, in *LogReq, opts ...grpc.CallOption) (*LogRsp, error) {
|
||||
out := new(LogRsp)
|
||||
func (c *loggerServiceClient) Log(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error) {
|
||||
out := new(Empty)
|
||||
err := c.cc.Invoke(ctx, "/servicepb.LoggerService/Log", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -46,7 +42,7 @@ func (c *loggerServiceClient) Log(ctx context.Context, in *LogReq, opts ...grpc.
|
||||
// All implementations must embed UnimplementedLoggerServiceServer
|
||||
// for forward compatibility
|
||||
type LoggerServiceServer interface {
|
||||
Log(context.Context, *LogReq) (*LogRsp, error)
|
||||
Log(context.Context, *Message) (*Empty, error)
|
||||
mustEmbedUnimplementedLoggerServiceServer()
|
||||
}
|
||||
|
||||
@@ -54,7 +50,7 @@ type LoggerServiceServer interface {
|
||||
type UnimplementedLoggerServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedLoggerServiceServer) Log(context.Context, *LogReq) (*LogRsp, error) {
|
||||
func (UnimplementedLoggerServiceServer) Log(context.Context, *Message) (*Empty, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method Log not implemented")
|
||||
}
|
||||
func (UnimplementedLoggerServiceServer) mustEmbedUnimplementedLoggerServiceServer() {}
|
||||
@@ -71,7 +67,7 @@ func RegisterLoggerServiceServer(s grpc.ServiceRegistrar, srv LoggerServiceServe
|
||||
}
|
||||
|
||||
func _LoggerService_Log_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LogReq)
|
||||
in := new(Message)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -83,7 +79,7 @@ func _LoggerService_Log_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: "/servicepb.LoggerService/Log",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(LoggerServiceServer).Log(ctx, req.(*LogReq))
|
||||
return srv.(LoggerServiceServer).Log(ctx, req.(*Message))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
31
service.go
31
service.go
@@ -13,13 +13,12 @@ import (
|
||||
"go.unistack.org/micro/v3/store"
|
||||
)
|
||||
|
||||
var _ logger.Logger = &serviceLogger{}
|
||||
|
||||
type serviceLogger struct {
|
||||
opts logger.Options
|
||||
service string
|
||||
client pbmicro.LoggerServiceClient
|
||||
store store.Store
|
||||
fields []interface{}
|
||||
}
|
||||
|
||||
func (l *serviceLogger) Clone(opts ...logger.Option) logger.Logger {
|
||||
@@ -35,7 +34,6 @@ func (l *serviceLogger) Level(lvl logger.Level) {
|
||||
}
|
||||
|
||||
func (l *serviceLogger) Init(opts ...logger.Option) error {
|
||||
// TODO: optimize to store only []string as fields
|
||||
for _, o := range opts {
|
||||
o(&l.opts)
|
||||
}
|
||||
@@ -64,8 +62,9 @@ func (l *serviceLogger) Init(opts ...logger.Option) error {
|
||||
}
|
||||
|
||||
func (l *serviceLogger) Fields(fields ...interface{}) logger.Logger {
|
||||
// TODO: optimize to store only []string as fields
|
||||
return l.Clone(logger.WithFields(fields...))
|
||||
nl := &serviceLogger{fields: l.fields, service: l.service, opts: l.opts, client: l.client, store: l.store}
|
||||
nl.fields = append(nl.fields, fields...)
|
||||
return nl
|
||||
}
|
||||
|
||||
func (l *serviceLogger) V(level logger.Level) bool {
|
||||
@@ -124,15 +123,17 @@ func (l *serviceLogger) Fatalf(ctx context.Context, msg string, args ...interfac
|
||||
|
||||
func (l *serviceLogger) Log(ctx context.Context, level logger.Level, args ...interface{}) {
|
||||
msg := l.newMessage(level, "", args...)
|
||||
if _, err := l.client.Log(ctx, msg); err != nil {
|
||||
_ = l.storeMessage(ctx, msg)
|
||||
_, err := l.client.Log(ctx, msg)
|
||||
if err != nil {
|
||||
l.storeMessage(ctx, msg)
|
||||
}
|
||||
}
|
||||
|
||||
func (l *serviceLogger) Logf(ctx context.Context, level logger.Level, format string, args ...interface{}) {
|
||||
msg := l.newMessage(level, "", args...)
|
||||
if _, err := l.client.Log(ctx, msg); err != nil {
|
||||
_ = l.storeMessage(ctx, msg)
|
||||
_, err := l.client.Log(ctx, msg)
|
||||
if err != nil {
|
||||
l.storeMessage(ctx, msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,18 +152,12 @@ func NewLogger(opts ...logger.Option) logger.Logger {
|
||||
return l
|
||||
}
|
||||
|
||||
func (l *serviceLogger) newMessage(level logger.Level, format string, args ...interface{}) *pb.LogReq {
|
||||
msg := &pb.LogReq{Level: int32(level), Format: format, Fields: make([]*pb.Field, 0, len(l.opts.Fields)/2)}
|
||||
for idx := 0; idx < len(l.opts.Fields); idx += 2 {
|
||||
msg.Fields = append(msg.Fields, &pb.Field{
|
||||
Key: fmt.Sprintf("%v", l.opts.Fields[idx]),
|
||||
Val: fmt.Sprintf("%v", l.opts.Fields[idx+1]),
|
||||
})
|
||||
}
|
||||
func (l *serviceLogger) newMessage(level logger.Level, format string, args ...interface{}) *pb.Message {
|
||||
msg := &pb.Message{Level: int32(level), Format: format}
|
||||
return msg
|
||||
}
|
||||
|
||||
func (l *serviceLogger) storeMessage(ctx context.Context, msg *pb.LogReq) error {
|
||||
func (l *serviceLogger) storeMessage(ctx context.Context, msg *pb.Message) error {
|
||||
if l.store == nil {
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user