Skip to content

Commit ce5bd2c

Browse files
committed
Remove logger name conversion
Callers must now provide dot qualified names FAB-12768 #done Change-Id: I0c9e63f292d19bf898d4e1ab499219d76cdcda43 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent be90d3c commit ce5bd2c

File tree

4 files changed

+2
-17
lines changed

4 files changed

+2
-17
lines changed

common/flogging/logging.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ package flogging
99
import (
1010
"io"
1111
"os"
12-
"strings"
1312
"sync"
1413

1514
"github.com/hyperledger/fabric/common/flogging/fabenc"
@@ -188,7 +187,6 @@ func (s *Logging) Encoding() Encoding {
188187
// enabled.
189188
func (s *Logging) ZapLogger(module string) *zap.Logger {
190189
s.mutex.RLock()
191-
module = strings.Replace(module, "/", ".", -1)
192190
levelEnabler := zap.LevelEnablerFunc(func(l zapcore.Level) bool {
193191
// always return true here because the core's Check()
194192
// method computes the level for the logger name based

common/flogging/logging_test.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,6 @@ func TestLoggingSetWriter(t *testing.T) {
5252
assert.EqualError(t, err, "welp")
5353
}
5454

55-
func TestZapLoggerNameConversion(t *testing.T) {
56-
logging, err := flogging.New(flogging.Config{
57-
LogSpec: "fatal:test=debug",
58-
})
59-
assert.NoError(t, err)
60-
61-
assert.Equal(t, zapcore.FatalLevel, logging.Level("test/module/name"))
62-
assert.Equal(t, zapcore.DebugLevel, logging.Level("test.module.name"))
63-
64-
logger := logging.Logger("test/module/name")
65-
assert.True(t, logger.IsEnabledFor(zapcore.DebugLevel))
66-
}
67-
6855
func TestNamedLogger(t *testing.T) {
6956
defer flogging.Reset()
7057
buf := &bytes.Buffer{}

orderer/common/cluster/replication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func BlockPullerFromConfigBlock(conf PullerConfig, block *common.Block) (*BlockP
6363
}
6464

6565
return &BlockPuller{
66-
Logger: flogging.MustGetLogger("orderer/common/cluster/replication"),
66+
Logger: flogging.MustGetLogger("orderer.common.cluster.replication"),
6767
Dialer: dialer,
6868
TLSCert: tlsCertAsDER.Bytes,
6969
VerifyBlockSequence: func(blocks []*common.Block) error {

token/client/tx_submitter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/pkg/errors"
2626
)
2727

28-
var logger = flogging.MustGetLogger("token/client")
28+
var logger = flogging.MustGetLogger("token.client")
2929

3030
type TxSubmitter struct {
3131
Config *ClientConfig

0 commit comments

Comments
 (0)