simplify logger creation (move logic into a function in main packages)

Ensure logger creation is consistent between Web and Collector
Create logger in main, pass down to downstream functions (like gin)
In debug mode, print a copy of AppConfig
Better debugging for logger.
This commit is contained in:
Jason Kulatunga
2022-08-03 22:51:44 -07:00
parent d41d535ab7
commit f823127825
13 changed files with 89 additions and 54 deletions
@@ -13,7 +13,7 @@ import (
// Send test notification
func SendTestNotification(c *gin.Context) {
appConfig := c.MustGet("CONFIG").(config.Interface)
logger := c.MustGet("LOGGER").(logrus.FieldLogger)
logger := c.MustGet("LOGGER").(*logrus.Entry)
testNotify := notify.New(
logger,