2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-10 11:31:58 +08:00

Clean up log messages

Moved development purpose log messages to DEBUG level.
This commit is contained in:
Ken Hibino 2020-05-11 07:02:26 -07:00
parent ae942c93e5
commit 0289bc7a10
7 changed files with 13 additions and 14 deletions

View File

@ -35,7 +35,7 @@ func init() {
flag.Var(&testLogLevel, "loglevel", "log level to use in testing")
testLogger = log.NewLogger(nil)
testLogger.SetLevel(log.Level(testLogLevel))
testLogger.SetLevel(toInternalLogLevel(testLogLevel))
}
func setup(tb testing.TB) *redis.Client {

View File

@ -38,7 +38,7 @@ func newHeartbeater(l *log.Logger, b base.Broker, ss *base.ServerState, interval
}
func (h *heartbeater) terminate() {
h.logger.Info("Heartbeater shutting down...")
h.logger.Debug("Heartbeater shutting down...")
// Signal the heartbeater goroutine to stop.
h.done <- struct{}{}
}
@ -54,7 +54,7 @@ func (h *heartbeater) start(wg *sync.WaitGroup) {
select {
case <-h.done:
h.broker.ClearServerState(h.ss)
h.logger.Info("Heartbeater done")
h.logger.Debug("Heartbeater done")
return
case <-time.After(h.interval):
h.beat()

View File

@ -106,7 +106,7 @@ func newProcessor(params newProcessorParams) *processor {
// It's safe to call this method multiple times.
func (p *processor) stop() {
p.once.Do(func() {
p.logger.Info("Processor shutting down...")
p.logger.Debug("Processor shutting down...")
// Unblock if processor is waiting for sema token.
close(p.abort)
// Signal the processor goroutine to stop processing tasks
@ -145,7 +145,7 @@ func (p *processor) start(wg *sync.WaitGroup) {
for {
select {
case <-p.done:
p.logger.Info("Processor done")
p.logger.Debug("Processor done")
return
default:
p.exec()

View File

@ -41,7 +41,7 @@ func newScheduler(l *log.Logger, b base.Broker, avgInterval time.Duration, qcfg
}
func (s *scheduler) terminate() {
s.logger.Info("Scheduler shutting down...")
s.logger.Debug("Scheduler shutting down...")
// Signal the scheduler goroutine to stop polling.
s.done <- struct{}{}
}
@ -54,7 +54,7 @@ func (s *scheduler) start(wg *sync.WaitGroup) {
for {
select {
case <-s.done:
s.logger.Info("Scheduler done")
s.logger.Debug("Scheduler done")
return
case <-time.After(s.avgInterval):
s.exec()

View File

@ -401,7 +401,6 @@ func (srv *Server) Stop() {
return
}
fmt.Println() // print newline for prettier log.
srv.logger.Info("Starting graceful shutdown")
// Note: The order of termination is important.
// Sender goroutines should be terminated before the receiver goroutines.
@ -417,7 +416,7 @@ func (srv *Server) Stop() {
srv.broker.Close()
srv.ss.SetStatus(base.StatusStopped)
srv.logger.Info("Bye!")
srv.logger.Info("Exiting")
}
// Quiet signals the server to stop pulling new tasks off queues.

View File

@ -38,7 +38,7 @@ func newSubscriber(l *log.Logger, b base.Broker, cancelations *base.Cancelations
}
func (s *subscriber) terminate() {
s.logger.Info("Subscriber shutting down...")
s.logger.Debug("Subscriber shutting down...")
// Signal the subscriber goroutine to stop.
s.done <- struct{}{}
}
@ -60,7 +60,7 @@ func (s *subscriber) start(wg *sync.WaitGroup) {
case <-time.After(s.retryTimeout):
continue
case <-s.done:
s.logger.Info("Subscriber done")
s.logger.Debug("Subscriber done")
return
}
}
@ -71,7 +71,7 @@ func (s *subscriber) start(wg *sync.WaitGroup) {
select {
case <-s.done:
pubsub.Close()
s.logger.Info("Subscriber done")
s.logger.Debug("Subscriber done")
return
case msg := <-cancelCh:
cancel, ok := s.cancelations.Get(msg.Payload)

View File

@ -40,7 +40,7 @@ func newSyncer(l *log.Logger, requestsCh <-chan *syncRequest, interval time.Dura
}
func (s *syncer) terminate() {
s.logger.Info("Syncer shutting down...")
s.logger.Debug("Syncer shutting down...")
// Signal the syncer goroutine to stop.
s.done <- struct{}{}
}
@ -59,7 +59,7 @@ func (s *syncer) start(wg *sync.WaitGroup) {
s.logger.Error(req.errMsg)
}
}
s.logger.Info("Syncer done")
s.logger.Debug("Syncer done")
return
case req := <-s.requestsCh:
requests = append(requests, req)