Replace logDebug with log.Debug

This commit is contained in:
Riccardo Biraghi
2018-04-09 12:45:45 +01:00
parent ab5d7ca1d1
commit ef04949036
2 changed files with 4 additions and 12 deletions

View File

@@ -31,14 +31,6 @@ import (
// var debug = false // var debug = false
var log *logger.Logger var log *logger.Logger
func logDebug(args ...interface{}) {
log.Debug(args)
}
func logDebugf(format string, args ...interface{}) {
log.Debugf(format, args...)
}
func logTerminationf(format string, args ...interface{}) { func logTerminationf(format string, args ...interface{}) {
logTermination(fmt.Sprintf(format, args)) logTermination(fmt.Sprintf(format, args))
} }
@@ -74,7 +66,7 @@ func mirrorQueueManagerErrorLogs(ctx context.Context, wg *sync.WaitGroup, name s
// Always use the JSON log as the source // Always use the JSON log as the source
qm, err := mqini.GetQueueManager(name) qm, err := mqini.GetQueueManager(name)
if err != nil { if err != nil {
logDebug(err) log.Debug(err)
return nil, err return nil, err
} }
f := filepath.Join(mqini.GetErrorLogDirectory(qm), "AMQERR01.json") f := filepath.Join(mqini.GetErrorLogDirectory(qm), "AMQERR01.json")

View File

@@ -49,13 +49,13 @@ func signalHandler(qmgr string) chan int {
// End the goroutine // End the goroutine
return return
case <-reapSignals: case <-reapSignals:
logDebug("Received SIGCHLD signal") log.Debug("Received SIGCHLD signal")
reapZombies() reapZombies()
case job := <-control: case job := <-control:
switch { switch {
case job == startReaping: case job == startReaping:
// Add SIGCHLD to the list of signals we're listening to // Add SIGCHLD to the list of signals we're listening to
logDebug("Listening for SIGCHLD signals") log.Debug("Listening for SIGCHLD signals")
signal.Notify(reapSignals, syscall.SIGCHLD) signal.Notify(reapSignals, syscall.SIGCHLD)
case job == reapNow: case job == reapNow:
reapZombies() reapZombies()
@@ -76,6 +76,6 @@ func reapZombies() {
if pid == 0 || err == unix.ECHILD { if pid == 0 || err == unix.ECHILD {
return return
} }
logDebugf("Reaped PID %v", pid) log.Debugf("Reaped PID %v", pid)
} }
} }