Skip to content

Commit

Permalink
Fix signal handler logging
Browse files Browse the repository at this point in the history
Some leftover cruft from pre-structured-logging which used a Sprintf,
resulted in unpopulated verb in message:
 msg="caught sig: %+v. Wait 2 seconds..."

Since the signal is explicitly included as a logfmt field, the message
can be simplified.

Demote the "Listening and waiting ..." message to debug, since
exporter-toolkit already logs that is listening.

Signed-off-by: Daniel Swarbrick <[email protected]>
  • Loading branch information
dswarbrick committed Sep 19, 2024
1 parent f7c5b30 commit d54d690
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apache_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func main() {

// listener for the termination signals from the OS
go func() {
logger.Info("listening and wait for graceful stop")
logger.Debug("Listening and waiting for graceful stop")
sig := <-gracefulStop
logger.Info("caught sig: %+v. Wait 2 seconds...", "sig", sig)
logger.Info("Caught signal. Wait 2 seconds...", "sig", sig)
time.Sleep(2 * time.Second)
os.Exit(0)
}()
Expand Down

0 comments on commit d54d690

Please sign in to comment.