Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Commit

Permalink
fix storehost logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranrg committed Apr 26, 2017
1 parent d81c1fa commit 7d5546c
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions services/storehost/storehost.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ import (
"github.com/uber/tchannel-go/thrift"
)

// Global logger for this storehost
var glog bark.Logger

// sealCheckInterval is the regular interval at which both the read and write paths check
// to see if the extent was sealed in the background. This is to handle the case where there
// are no more messages available, and asynchronously the extent was sealed.
Expand Down Expand Up @@ -224,24 +221,24 @@ func NewStoreHost(serviceName string, sCommon common.SCommon, mClient metadata.T
opts = &Options{}
}

logger := sCommon.GetConfig().GetLogger().WithFields(bark.Fields{
common.TagStor: common.FmtStor(sCommon.GetHostUUID()),
common.TagDplName: common.FmtDplName(sCommon.GetConfig().GetDeploymentName()),
})

m3Client := metrics.NewClient(sCommon.GetMetricsReporter(), metrics.Storage)

t := &StoreHost{
SCommon: sCommon,
opts: opts,
hostMetrics: load.NewHostMetrics(),
shutdownC: make(chan struct{}),
disableWriteC: make(chan struct{}),
m3Client: metrics.NewClient(sCommon.GetMetricsReporter(), metrics.Storage),
logger: logger,
m3Client: m3Client,
mClient: mm.NewMetadataMetricsMgr(mClient, m3Client, logger),
}

t.logger = common.GetDefaultLogger().WithFields(bark.Fields{
common.TagStor: common.FmtStor(sCommon.GetHostUUID()),
common.TagDplName: common.FmtDplName(sCommon.GetConfig().GetDeploymentName()),
})

glog = t.logger

t.mClient = mm.NewMetadataMetricsMgr(mClient, t.m3Client, t.logger)

return t, []thrift.TChanServer{store.NewTChanBStoreServer(t)}
}

Expand Down

0 comments on commit 7d5546c

Please sign in to comment.