-
Notifications
You must be signed in to change notification settings - Fork 1
/
server_logger.go
36 lines (30 loc) · 997 Bytes
/
server_logger.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package grpcp
import (
"github.com/ambientkit/ambient"
"github.com/ambientkit/ambient/pkg/grpcp/protodef"
"golang.org/x/net/context"
)
// GRPCLoggerServer is the gRPC server that GRPCClient talks to.
type GRPCLoggerServer struct {
Impl ambient.Logger
}
// Debug -
func (m *GRPCLoggerServer) Debug(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error) {
m.Impl.Debug(req.Format)
return &protodef.Empty{}, err
}
// Info -
func (m *GRPCLoggerServer) Info(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error) {
m.Impl.Info(req.Format)
return &protodef.Empty{}, err
}
// Warn -
func (m *GRPCLoggerServer) Warn(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error) {
m.Impl.Warn(req.Format)
return &protodef.Empty{}, err
}
// Error -
func (m *GRPCLoggerServer) Error(ctx context.Context, req *protodef.LogFormat) (resp *protodef.Empty, err error) {
m.Impl.Error(req.Format)
return &protodef.Empty{}, err
}