From 212832eda18c49667682ac02702f683fea2e085c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 15 Jan 2024 22:44:28 -0500 Subject: [PATCH] refactor: since Portal.Logger can return a temporary logger, just use it --- cmd/portal/init.go | 2 +- config/config.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/portal/init.go b/cmd/portal/init.go index e535e5f..8e69918 100644 --- a/cmd/portal/init.go +++ b/cmd/portal/init.go @@ -13,7 +13,7 @@ import ( type initFunc func(p interfaces.Portal) error func initConfig(p interfaces.Portal) error { - return config.Init() + return config.Init(p) } func initIdentity(p interfaces.Portal) error { diff --git a/config/config.go b/config/config.go index d2a6149..5da6052 100644 --- a/config/config.go +++ b/config/config.go @@ -2,8 +2,8 @@ package config import ( "errors" + "git.lumeweb.com/LumeWeb/portal/interfaces" "github.com/spf13/viper" - "go.uber.org/zap" ) var ( @@ -14,8 +14,8 @@ var ( } ) -func Init() error { - logger, _ := zap.NewDevelopment() +func Init(p interfaces.Portal) error { + logger := p.Logger() viper.SetConfigName("config") viper.SetConfigType("yaml")