3
* Copyright 2018 gRPC authors.
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
9
* http://www.apache.org/licenses/LICENSE-2.0
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
19
// This file contains exported variables/functions that are exported for testing
22
// An ideal way for this would be to put those in a *_test.go but in binarylog
23
// package. But this doesn't work with staticcheck with go module. Error was:
24
// "MdToMetadataProto not declared by package binarylog". This could be caused
25
// by the way staticcheck looks for files for a certain package, which doesn't
26
// support *_test.go files.
28
// Move those to binary_test.go when staticcheck is fixed.
33
// AllLogger is a logger that logs all headers/messages for all RPCs. It's
35
AllLogger = NewLoggerFromConfigString("*")
36
// MdToMetadataProto converts metadata to a binary logging proto message.
37
// It's for testing only.
38
MdToMetadataProto = mdToMetadataProto
39
// AddrToProto converts an address to a binary logging proto message. It's
41
AddrToProto = addrToProto