Skip to content

Commit

Permalink
fix: log args
Browse files Browse the repository at this point in the history
  • Loading branch information
janiltonmaciel committed Aug 20, 2020
1 parent f04cf70 commit 100a6e1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions enqueuestomp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

"github.com/globocom/enqueuestomp"
"github.com/go-stomp/stomp"
"go.uber.org/zap"
check "gopkg.in/check.v1"
)

Expand Down Expand Up @@ -431,3 +432,20 @@ func (s *EnqueueStompSuite) TestConfigOptions(c *check.C) {
enqueueCount := s.j.StatQueue(queueName, "EnqueueCount")
c.Assert(enqueueCount, check.Equals, "1")
}

func (s *EnqueueStompSuite) TestSendConfigLogger(c *check.C) {
sugar := zap.NewExample().Sugar()
enqueueConfig := enqueuestomp.Config{
Logger: sugar,
}
enqueue, err := enqueuestomp.NewEnqueueStomp(enqueueConfig)
c.Assert(err, check.IsNil)

sc := enqueuestomp.SendConfig{}
err = enqueue.SendQueue(queueName, queueBody, sc)
c.Assert(err, check.IsNil)
s.waitQueueSize(enqueue)

enqueueCount := s.j.StatQueue(queueName, "EnqueueCount")
c.Assert(enqueueCount, check.Equals, "1")
}
4 changes: 2 additions & 2 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ func (emq *EnqueueStomp) writeOutput(action string, identifier string, destinati
}

func (emq *EnqueueStomp) debugLogger(template string, args ...interface{}) {
emq.log.Debugf(template, args)
emq.log.Debugf(template, args...)
}

func (emq *EnqueueStomp) errorLogger(template string, args ...interface{}) {
emq.log.Errorf(template, args)
emq.log.Errorf(template, args...)
}

0 comments on commit 100a6e1

Please sign in to comment.