Skip to content

Commit 1964bfe

Browse files
committed
[FAB-10501] Log EndorseWithPlugin messages at debug
This CR changes the log level for the messages in the main flow of EndorseWithPlugin from INFO to DEBUG to remove the unnecessary noise at the info level. It also fixes a few minor golint issues. Change-Id: I04eca62c891d05e12210197106d11cfbcb68defc Signed-off-by: Will Lahti <wtlahti@us.ibm.com>
1 parent 288a62c commit 1964bfe

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

core/endorser/plugin_endorser.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,23 @@ import (
2121

2222
//go:generate mockery -dir . -name TransientStoreRetriever -case underscore -output mocks/
2323
//go:generate mockery -dir ../transientstore/ -name Store -case underscore -output mocks/
24+
2425
// TransientStoreRetriever retrieves transient stores
2526
type TransientStoreRetriever interface {
2627
// StoreForChannel returns the transient store for the given channel
2728
StoreForChannel(channel string) transientstore.Store
2829
}
2930

3031
//go:generate mockery -dir . -name ChannelStateRetriever -case underscore -output mocks/
32+
3133
// ChannelStateRetriever retrieves Channel state
3234
type ChannelStateRetriever interface {
3335
// ChannelState returns a QueryCreator for the given Channel
3436
NewQueryCreator(channel string) (QueryCreator, error)
3537
}
3638

3739
//go:generate mockery -dir . -name PluginMapper -case underscore -output mocks/
40+
3841
// PluginMapper maps plugin names to their corresponding factories
3942
type PluginMapper interface {
4043
PluginFactoryByName(name PluginName) endorsement.PluginFactory
@@ -157,10 +160,10 @@ type PluginEndorser struct {
157160

158161
// EndorseWithPlugin endorses the response with a plugin
159162
func (pe *PluginEndorser) EndorseWithPlugin(ctx Context) (*pb.ProposalResponse, error) {
160-
endorserLogger.Info("Entering endorsement for", ctx)
163+
endorserLogger.Debug("Entering endorsement for", ctx)
161164

162165
if ctx.Response == nil {
163-
return nil, errors.New("Response is nil")
166+
return nil, errors.New("response is nil")
164167
}
165168

166169
if ctx.Response.Status >= shim.ERRORTHRESHOLD {
@@ -191,7 +194,7 @@ func (pe *PluginEndorser) EndorseWithPlugin(ctx Context) (*pb.ProposalResponse,
191194
Payload: prpBytes,
192195
Response: ctx.Response,
193196
}
194-
endorserLogger.Info("Exiting", ctx)
197+
endorserLogger.Debug("Exiting", ctx)
195198
return resp, nil
196199
}
197200

core/endorser/plugin_endorser_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,7 @@ func TestPluginEndorserErrors(t *testing.T) {
201201
t.Run("ResponseIsNil", func(t *testing.T) {
202202
resp, err := pluginEndorser.EndorseWithPlugin(endorser.Context{})
203203
assert.Nil(t, resp)
204-
assert.Contains(t, err.Error(), "Response is nil")
205-
204+
assert.Contains(t, err.Error(), "response is nil")
206205
})
207206
}
208207

0 commit comments

Comments
 (0)