mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-20 21:14:37 -04:00
Replace logging with default logging interface (#233)
* Add test logger * Refactor access manager logging * Refactor activation service logging * Refactor debugd logging * Refactor kms server logging * Refactor disk-mapper logging Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
e3f78a5bff
commit
b10b13b173
42 changed files with 513 additions and 328 deletions
17
internal/grpc/grpclog/grplog.go
Normal file
17
internal/grpc/grpclog/grplog.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
// grpclog provides a logging utilities for gRPC.
|
||||
package grpclog
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"google.golang.org/grpc/peer"
|
||||
)
|
||||
|
||||
// PeerAddrFromContext returns a peer's address from context, or "unknown" if not found.
|
||||
func PeerAddrFromContext(ctx context.Context) string {
|
||||
p, ok := peer.FromContext(ctx)
|
||||
if !ok {
|
||||
return "unknown"
|
||||
}
|
||||
return p.Addr.String()
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue