Skip to content

Commit

Permalink
Use correct log level instead of fmt prints
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Feb 21, 2019
1 parent 792ea13 commit eab43e1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion balloon/hyper/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (p *InsertPruner) traverse(pos navigator.Position, leaves storage.KVRange)
// if we are over the cache level, we need to do a range query to get the leaves
var atLastLevel bool
if atLastLevel = p.cacheResolver.ShouldCache(pos); atLastLevel {
//fmt.Println(pos.Height())
//log.Info(pos.Height())
first := p.navigator.DescendToFirst(pos)
last := p.navigator.DescendToLast(pos)

Expand Down
4 changes: 2 additions & 2 deletions gossip/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Agent struct {
}

func NewAgent(conf *Config, p []Processor) (agent *Agent, err error) {
fmt.Printf("New agent %s\n", conf.NodeName)
log.Infof("New agent %s\n", conf.NodeName)
agent = &Agent{
config: conf,
Topology: NewTopology(),
Expand Down Expand Up @@ -231,7 +231,7 @@ func (a *Agent) Leave() error {
//
// It is safe to call this method multiple times.
func (a *Agent) Shutdown() error {
fmt.Printf("\nShutting down agent %s", a.config.NodeName)
log.Info("\nShutting down agent %s", a.config.NodeName)
a.stateLock.Lock()
defer a.stateLock.Unlock()

Expand Down
1 change: 1 addition & 0 deletions gossip/auditor/auditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ func (t MembershipTask) Do() {
t.sendAlert(fmt.Sprintf("Unable to verify snapshot %v", t.s.Snapshot))
log.Infof("Unable to verify snapshot %v", t.s.Snapshot)
}

log.Infof("MembershipTask.Do(): Snapshot %v has been verified by QED", t.s.Snapshot)
}

Expand Down
2 changes: 1 addition & 1 deletion gossip/sender/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (s *Sender) doSign(snapshot *protocol.Snapshot) (*protocol.SignedSnapshot,

signature, err := s.signer.Sign([]byte(fmt.Sprintf("%v", snapshot)))
if err != nil {
fmt.Println("Publisher: error signing snapshot")
log.Info("Publisher: error signing snapshot")
return nil, err
}
return &protocol.SignedSnapshot{Snapshot: snapshot, Signature: signature}, nil
Expand Down
5 changes: 2 additions & 3 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ func join(joinAddr, raftAddr, nodeID string) error {
// Start will start the server in a non-blockable fashion.
func (s *Server) Start() error {
metrics.Qed_instances_count.Inc()
log.Debugf("Starting QED server...")
fmt.Printf("Starting QED server %s\n", s.conf.NodeID)
log.Infof("Starting QED server %s\n", s.conf.NodeID)

err := s.raftBalloon.Open(s.bootstrap)
if err != nil {
Expand Down Expand Up @@ -286,7 +285,7 @@ func (s *Server) Start() error {
// Stop will close all the channels from the mux servers.
func (s *Server) Stop() error {
metrics.Qed_instances_count.Dec()
fmt.Printf("\nShutting down QED server %s", s.conf.NodeID)
log.Infof("\nShutting down QED server %s", s.conf.NodeID)

log.Debugf("Metrics enabled: stopping server...")
if err := s.metricsServer.Shutdown(context.Background()); err != nil { // TODO include timeout instead nil
Expand Down

0 comments on commit eab43e1

Please sign in to comment.