diff --git a/orderer/common/blockcutter/blockcutter.go b/orderer/common/blockcutter/blockcutter.go index ac1cb14633f..abb2f89d11a 100644 --- a/orderer/common/blockcutter/blockcutter.go +++ b/orderer/common/blockcutter/blockcutter.go @@ -10,10 +10,17 @@ import ( "github.com/hyperledger/fabric/common/channelconfig" cb "github.com/hyperledger/fabric/protos/common" + "github.com/hyperledger/fabric/common/flogging" "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/common/blockcutter") +const pkgLogID = "orderer/common/blockcutter" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} // Receiver defines a sink for the ordered broadcast messages type Receiver interface { diff --git a/orderer/common/blockcutter/blockcutter_test.go b/orderer/common/blockcutter/blockcutter_test.go index 18a6443da5a..d1b13aa09d5 100644 --- a/orderer/common/blockcutter/blockcutter_test.go +++ b/orderer/common/blockcutter/blockcutter_test.go @@ -23,12 +23,12 @@ import ( cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" - logging "github.com/op/go-logging" + "github.com/hyperledger/fabric/common/flogging" "github.com/stretchr/testify/assert" ) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } var tx = &cb.Envelope{Payload: []byte("GOOD")} diff --git a/orderer/common/broadcast/broadcast.go b/orderer/common/broadcast/broadcast.go index 156d43e8ad2..40f91f60657 100644 --- a/orderer/common/broadcast/broadcast.go +++ b/orderer/common/broadcast/broadcast.go @@ -9,6 +9,7 @@ package broadcast import ( "io" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/orderer/common/msgprocessor" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" @@ -18,7 +19,13 @@ import ( "github.com/pkg/errors" ) -var logger = logging.MustGetLogger("orderer/common/broadcast") +const pkgLogID = "orderer/common/broadcast" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} // Handler defines an interface which handles broadcasts type Handler interface { @@ -113,9 +120,7 @@ func (bh *handlerImpl) Handle(srv ab.AtomicBroadcast_BroadcastServer) error { } } - if logger.IsEnabledFor(logging.DEBUG) { - logger.Debugf("[channel: %s] Broadcast has successfully enqueued message of type %s from %s", chdr.ChannelId, cb.HeaderType_name[chdr.Type], addr) - } + logger.Debugf("[channel: %s] Broadcast has successfully enqueued message of type %s from %s", chdr.ChannelId, cb.HeaderType_name[chdr.Type], addr) err = srv.Send(&ab.BroadcastResponse{Status: cb.Status_SUCCESS}) if err != nil { diff --git a/orderer/common/broadcast/broadcast_test.go b/orderer/common/broadcast/broadcast_test.go index 67304bb93a8..b74c6ed6cf2 100644 --- a/orderer/common/broadcast/broadcast_test.go +++ b/orderer/common/broadcast/broadcast_test.go @@ -12,10 +12,10 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/orderer/common/msgprocessor" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" - logging "github.com/op/go-logging" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "golang.org/x/net/context" @@ -24,7 +24,7 @@ import ( ) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } type mockStream struct { diff --git a/orderer/common/deliver/deliver.go b/orderer/common/deliver/deliver.go index 8672c933c3d..60f84e77e6b 100644 --- a/orderer/common/deliver/deliver.go +++ b/orderer/common/deliver/deliver.go @@ -19,6 +19,7 @@ package deliver import ( "io" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/orderer/common/ledger" "github.com/hyperledger/fabric/orderer/common/msgprocessor" @@ -31,7 +32,13 @@ import ( "github.com/hyperledger/fabric/protos/utils" ) -var logger = logging.MustGetLogger("orderer/common/deliver") +const pkgLogID = "orderer/common/deliver" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} // Handler defines an interface which handles Deliver requests type Handler interface { diff --git a/orderer/common/deliver/deliver_test.go b/orderer/common/deliver/deliver_test.go index 19d085b923a..7a16eb20a35 100644 --- a/orderer/common/deliver/deliver_test.go +++ b/orderer/common/deliver/deliver_test.go @@ -22,6 +22,7 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/common/flogging" mockpolicies "github.com/hyperledger/fabric/common/mocks/policies" "github.com/hyperledger/fabric/common/policies" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" @@ -30,7 +31,6 @@ import ( cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" "github.com/hyperledger/fabric/protos/utils" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" "golang.org/x/net/context" "google.golang.org/grpc" @@ -44,7 +44,7 @@ var systemChainID = "systemChain" const ledgerSize = 10 func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } type mockStream struct { diff --git a/orderer/common/ledger/file/impl.go b/orderer/common/ledger/file/impl.go index 6d4e99b1999..7a0828b6469 100644 --- a/orderer/common/ledger/file/impl.go +++ b/orderer/common/ledger/file/impl.go @@ -17,6 +17,7 @@ limitations under the License. package fileledger import ( + "github.com/hyperledger/fabric/common/flogging" cl "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/ledger/blkstorage" ledger "github.com/hyperledger/fabric/orderer/common/ledger" @@ -25,10 +26,14 @@ import ( "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/fileledger") +const pkgLogID = "orderer/ledger/fileledger" + +var logger *logging.Logger + var closedChan chan struct{} func init() { + logger = flogging.MustGetLogger(pkgLogID) closedChan = make(chan struct{}) close(closedChan) } diff --git a/orderer/common/ledger/file/impl_test.go b/orderer/common/ledger/file/impl_test.go index b6fda597805..e8d51254dd1 100644 --- a/orderer/common/ledger/file/impl_test.go +++ b/orderer/common/ledger/file/impl_test.go @@ -23,13 +23,13 @@ import ( "os" "testing" + "github.com/hyperledger/fabric/common/flogging" cl "github.com/hyperledger/fabric/common/ledger" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" "github.com/hyperledger/fabric/orderer/common/ledger" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" "github.com/hyperledger/fabric/protos/peer" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) @@ -37,7 +37,7 @@ import ( var genesisBlock = cb.NewBlock(0, nil) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } type testEnv struct { diff --git a/orderer/common/ledger/json/impl.go b/orderer/common/ledger/json/impl.go index 53c34e0abde..d9e3123f36b 100644 --- a/orderer/common/ledger/json/impl.go +++ b/orderer/common/ledger/json/impl.go @@ -23,6 +23,7 @@ import ( "path/filepath" "sync" + "github.com/hyperledger/fabric/common/flogging" ledger "github.com/hyperledger/fabric/orderer/common/ledger" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" @@ -31,11 +32,14 @@ import ( "github.com/golang/protobuf/jsonpb" ) -var logger = logging.MustGetLogger("orderer/jsonledger") +const pkgLogID = "orderer/ledger/jsonledger" + +var logger *logging.Logger var closedChan chan struct{} var fileLock sync.Mutex func init() { + logger = flogging.MustGetLogger(pkgLogID) closedChan = make(chan struct{}) close(closedChan) } diff --git a/orderer/common/ledger/json/impl_test.go b/orderer/common/ledger/json/impl_test.go index 6ea56aa6abd..5e6c4f36680 100644 --- a/orderer/common/ledger/json/impl_test.go +++ b/orderer/common/ledger/json/impl_test.go @@ -22,19 +22,19 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" "github.com/hyperledger/fabric/orderer/common/ledger" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" ) var genesisBlock = cb.NewBlock(0, nil) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } type testEnv struct { diff --git a/orderer/common/ledger/ram/impl.go b/orderer/common/ledger/ram/impl.go index 9ce5cee0032..ed664a4bb91 100644 --- a/orderer/common/ledger/ram/impl.go +++ b/orderer/common/ledger/ram/impl.go @@ -20,13 +20,20 @@ import ( "bytes" "fmt" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/orderer/common/ledger" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/ramledger") +const pkgLogID = "orderer/ledger/ramledger" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} type cursor struct { list *simpleList diff --git a/orderer/common/ledger/ram/impl_test.go b/orderer/common/ledger/ram/impl_test.go index de5af9c538d..7146b0eb64c 100644 --- a/orderer/common/ledger/ram/impl_test.go +++ b/orderer/common/ledger/ram/impl_test.go @@ -19,18 +19,17 @@ package ramledger import ( "testing" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" "github.com/hyperledger/fabric/orderer/common/ledger" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" - - logging "github.com/op/go-logging" ) var genesisBlock = cb.NewBlock(0, nil) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } func newTestChain(maxSize int) *ramLedger { diff --git a/orderer/common/localconfig/config.go b/orderer/common/localconfig/config.go index d183d00bba0..f61647df968 100644 --- a/orderer/common/localconfig/config.go +++ b/orderer/common/localconfig/config.go @@ -36,7 +36,7 @@ import ( ) const ( - pkgLogID = "orderer/common/localconfig" + pkgLogID = "orderer/common/config" // Prefix identifies the prefix for the orderer-related ENV vars. Prefix = "ORDERER" @@ -50,7 +50,7 @@ var ( func init() { logger = flogging.MustGetLogger(pkgLogID) - flogging.SetModuleLevel(pkgLogID, "error") + flogging.SetModuleLevel(pkgLogID, "ERROR") configName = strings.ToLower(Prefix) } diff --git a/orderer/common/localconfig/config_test.go b/orderer/common/localconfig/config_test.go index 95adb4fd243..2a6a2569940 100644 --- a/orderer/common/localconfig/config_test.go +++ b/orderer/common/localconfig/config_test.go @@ -24,10 +24,15 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" "github.com/stretchr/testify/assert" ) +func init() { + flogging.SetModuleLevel(pkgLogID, "DEBUG") +} + func TestGoodConfig(t *testing.T) { assert.NotNil(t, Load(), "Could not load config") } diff --git a/orderer/common/msgprocessor/msgprocessor.go b/orderer/common/msgprocessor/msgprocessor.go index 6bd0ecc6f49..3a6719f91f6 100644 --- a/orderer/common/msgprocessor/msgprocessor.go +++ b/orderer/common/msgprocessor/msgprocessor.go @@ -13,16 +13,23 @@ import ( "github.com/hyperledger/fabric/common/flogging" cb "github.com/hyperledger/fabric/protos/common" + logging "github.com/op/go-logging" ) -var logger = flogging.MustGetLogger("common/msgprocessor") - const ( + pkgLogID = "orderer/common/msgprocessor" + // These should eventually be derived from the channel support once enabled msgVersion = int32(0) epoch = 0 ) +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} + // ErrChannelDoesNotExist is returned by the system channel for transactions which // are not for the system channel ID and are not attempting to create a new channel var ErrChannelDoesNotExist = errors.New("channel does not exist") diff --git a/orderer/common/msgprocessor/sigfilter_test.go b/orderer/common/msgprocessor/sigfilter_test.go index 9200e820d57..e9f3eebef25 100644 --- a/orderer/common/msgprocessor/sigfilter_test.go +++ b/orderer/common/msgprocessor/sigfilter_test.go @@ -10,17 +10,17 @@ import ( "fmt" "testing" + "github.com/hyperledger/fabric/common/flogging" mockpolicies "github.com/hyperledger/fabric/common/mocks/policies" cb "github.com/hyperledger/fabric/protos/common" "github.com/hyperledger/fabric/protos/utils" - "github.com/op/go-logging" "github.com/pkg/errors" "github.com/stretchr/testify/assert" ) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } func makeEnvelope() *cb.Envelope { diff --git a/orderer/common/multichannel/registrar.go b/orderer/common/multichannel/registrar.go index f0e519b301c..1ed6c32dae0 100644 --- a/orderer/common/multichannel/registrar.go +++ b/orderer/common/multichannel/registrar.go @@ -15,6 +15,7 @@ import ( "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/configtx" configtxapi "github.com/hyperledger/fabric/common/configtx/api" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/orderer/common/ledger" "github.com/hyperledger/fabric/orderer/common/msgprocessor" "github.com/hyperledger/fabric/orderer/consensus" @@ -26,13 +27,19 @@ import ( "github.com/hyperledger/fabric/common/crypto" ) -var logger = logging.MustGetLogger("orderer/multichannel") - const ( + pkgLogID = "orderer/commmon/multichannel" + msgVersion = int32(0) epoch = 0 ) +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} + type mutableResources interface { channelconfig.Resources Update(*channelconfig.Bundle) diff --git a/orderer/common/multichannel/registrar_test.go b/orderer/common/multichannel/registrar_test.go index fef479362d6..352865a793f 100644 --- a/orderer/common/multichannel/registrar_test.go +++ b/orderer/common/multichannel/registrar_test.go @@ -14,6 +14,7 @@ import ( "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/channelconfig" "github.com/hyperledger/fabric/common/crypto" + "github.com/hyperledger/fabric/common/flogging" mockcrypto "github.com/hyperledger/fabric/common/mocks/crypto" genesisconfig "github.com/hyperledger/fabric/common/tools/configtxgen/localconfig" "github.com/hyperledger/fabric/common/tools/configtxgen/provisional" @@ -26,7 +27,6 @@ import ( "github.com/hyperledger/fabric/protos/utils" mmsp "github.com/hyperledger/fabric/common/mocks/msp" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" ) @@ -37,7 +37,7 @@ var mockSigningIdentity msp.SigningIdentity const NoConsortiumChain = "no-consortium-chain" func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") mockSigningIdentity, _ = mmsp.NewNoopMsp().GetDefaultSigningIdentity() conf = genesisconfig.Load(genesisconfig.SampleInsecureProfile) diff --git a/orderer/common/performance/server.go b/orderer/common/performance/server.go index 7f0c3d50b9b..898d4fa0027 100644 --- a/orderer/common/performance/server.go +++ b/orderer/common/performance/server.go @@ -10,6 +10,7 @@ import ( "io" "sync" + "github.com/hyperledger/fabric/common/flogging" cb "github.com/hyperledger/fabric/protos/common" ab "github.com/hyperledger/fabric/protos/orderer" "github.com/op/go-logging" @@ -18,7 +19,13 @@ import ( "google.golang.org/grpc/peer" ) -var logger = logging.MustGetLogger("orderer/performance") +const pkgLogID = "orderer/common/performance" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} // BenchmarkServer is a pseudo-server that grpc services could be registered to type BenchmarkServer struct { diff --git a/orderer/common/performance/utils.go b/orderer/common/performance/utils.go index 557d6835c6c..5fc1f8f1b88 100644 --- a/orderer/common/performance/utils.go +++ b/orderer/common/performance/utils.go @@ -24,7 +24,8 @@ import ( ) const ( - Kilo = 1024 // TODO(jay_guo) consider adding an unit pkg + // Kilo allows us to convert byte units to kB. + Kilo = 1024 // TODO Consider adding a unit pkg ) var conf *config.TopLevel diff --git a/orderer/common/server/main.go b/orderer/common/server/main.go index 367e8827a1f..2a58b8e5663 100644 --- a/orderer/common/server/main.go +++ b/orderer/common/server/main.go @@ -40,7 +40,13 @@ import ( "gopkg.in/alecthomas/kingpin.v2" ) -var logger = logging.MustGetLogger("orderer/server/main") +const pkgLogID = "orderer/common/server" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} //command line flags var ( diff --git a/orderer/common/server/main_test.go b/orderer/common/server/main_test.go index c2fd52a1554..ba7b2f40394 100644 --- a/orderer/common/server/main_test.go +++ b/orderer/common/server/main_test.go @@ -28,14 +28,22 @@ import ( "github.com/stretchr/testify/assert" ) +func init() { + flogging.SetModuleLevel(pkgLogID, "DEBUG") +} + func TestInitializeLoggingLevel(t *testing.T) { initializeLoggingLevel( &config.TopLevel{ - General: config.General{LogLevel: "debug"}, + // We specify the package name here, in contrast to what's expected + // in production usage. We do this so as to prevent the unwanted + // global log level setting in tests of this package (for example, + // the benchmark-related ones) that would occur otherwise. + General: config.General{LogLevel: "foo=debug"}, Kafka: config.Kafka{Verbose: true}, }, ) - assert.Equal(t, flogging.GetModuleLevel("orderer/main"), "DEBUG") + assert.Equal(t, flogging.GetModuleLevel("foo"), "DEBUG") assert.NotNil(t, sarama.Logger) } diff --git a/orderer/common/server/server_test.go b/orderer/common/server/server_test.go index 000a851ed25..bfc54fc4760 100644 --- a/orderer/common/server/server_test.go +++ b/orderer/common/server/server_test.go @@ -18,17 +18,12 @@ import ( ab "github.com/hyperledger/fabric/protos/orderer" "github.com/hyperledger/fabric/protos/utils" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" "golang.org/x/net/context" "google.golang.org/grpc" "google.golang.org/grpc/peer" ) -func init() { - logging.SetLevel(logging.DEBUG, "") -} - func TestBroadcastNoPanic(t *testing.T) { // Defer recovers from the panic _ = (&server{}).Broadcast(nil) @@ -59,7 +54,7 @@ func (mbs *mockBroadcastSrv) Recv() (*cb.Envelope, error) { return mbs.msg, mbs.err } -func (mb *mockBroadcastSrv) Send(br *ab.BroadcastResponse) error { +func (mbs *mockBroadcastSrv) Send(br *ab.BroadcastResponse) error { panic("Unimplimented") } diff --git a/orderer/consensus/kafka/consenter.go b/orderer/consensus/kafka/consenter.go index 7bb27ff2b88..a7214a1b5e4 100644 --- a/orderer/consensus/kafka/consenter.go +++ b/orderer/consensus/kafka/consenter.go @@ -15,7 +15,7 @@ import ( logging "github.com/op/go-logging" ) -const pkgLogID = "orderer/kafka" +const pkgLogID = "orderer/consensus/kafka" var logger *logging.Logger diff --git a/orderer/consensus/solo/consensus.go b/orderer/consensus/solo/consensus.go index 6ec4c82edf1..33809920ade 100644 --- a/orderer/consensus/solo/consensus.go +++ b/orderer/consensus/solo/consensus.go @@ -20,12 +20,19 @@ import ( "fmt" "time" + "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/orderer/consensus" cb "github.com/hyperledger/fabric/protos/common" "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/solo") +const pkgLogID = "orderer/consensus/solo" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} type consenter struct{} diff --git a/orderer/consensus/solo/consensus_test.go b/orderer/consensus/solo/consensus_test.go index 6659296430b..3d363c5b8a0 100644 --- a/orderer/consensus/solo/consensus_test.go +++ b/orderer/consensus/solo/consensus_test.go @@ -20,18 +20,18 @@ import ( "testing" "time" + "github.com/hyperledger/fabric/common/flogging" mockconfig "github.com/hyperledger/fabric/common/mocks/config" mockblockcutter "github.com/hyperledger/fabric/orderer/mocks/common/blockcutter" mockmultichannel "github.com/hyperledger/fabric/orderer/mocks/common/multichannel" cb "github.com/hyperledger/fabric/protos/common" "github.com/hyperledger/fabric/protos/utils" - logging "github.com/op/go-logging" "github.com/stretchr/testify/assert" ) func init() { - logging.SetLevel(logging.DEBUG, "") + flogging.SetModuleLevel(pkgLogID, "DEBUG") } var testMessage = &cb.Envelope{ diff --git a/orderer/mocks/common/blockcutter/blockcutter.go b/orderer/mocks/common/blockcutter/blockcutter.go index 8ca6b00ffce..82bbfe29d8e 100644 --- a/orderer/mocks/common/blockcutter/blockcutter.go +++ b/orderer/mocks/common/blockcutter/blockcutter.go @@ -14,17 +14,21 @@ See the License for the specific language governing permissions and limitations under the License. */ -package mocks +package blockcutter import ( + "github.com/hyperledger/fabric/common/flogging" cb "github.com/hyperledger/fabric/protos/common" -) - -import ( "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/mocks/blockcutter") +const pkgLogID = "orderer/mocks/common/blockcutter" + +var logger *logging.Logger + +func init() { + logger = flogging.MustGetLogger(pkgLogID) +} // Receiver mocks the blockcutter.Receiver interface type Receiver struct { diff --git a/orderer/mocks/common/blockcutter/blockcutter_test.go b/orderer/mocks/common/blockcutter/blockcutter_test.go index 514e538ec7f..825a5176cc7 100644 --- a/orderer/mocks/common/blockcutter/blockcutter_test.go +++ b/orderer/mocks/common/blockcutter/blockcutter_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package mocks +package blockcutter import ( "testing" diff --git a/orderer/mocks/common/multichannel/multichannel.go b/orderer/mocks/common/multichannel/multichannel.go index c5c44b146d0..b695771f0d4 100644 --- a/orderer/mocks/common/multichannel/multichannel.go +++ b/orderer/mocks/common/multichannel/multichannel.go @@ -14,12 +14,8 @@ import ( mockblockcutter "github.com/hyperledger/fabric/orderer/mocks/common/blockcutter" cb "github.com/hyperledger/fabric/protos/common" "github.com/hyperledger/fabric/protos/utils" - - "github.com/op/go-logging" ) -var logger = logging.MustGetLogger("orderer/mocks/multichannel") - // ConsenterSupport is used to mock the multichannel.ConsenterSupport interface // Whenever a block is written, it writes to the Batches channel to allow for synchronization type ConsenterSupport struct {