From 0c9a300a58d9dacce7b84ff93222eed35eab5721 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 20 Jul 2022 16:07:13 +0200 Subject: Refactor: Do not log in internal packages The reason behind this is that we then do not have to pass a lot to each function. Logging inside internal packages is less useful as we want to let them return errors and only log in the 'public' facing API or let the client decide --- internal/server/instituteaccess.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'internal/server/instituteaccess.go') diff --git a/internal/server/instituteaccess.go b/internal/server/instituteaccess.go index 9e712bd..1da2d1e 100644 --- a/internal/server/instituteaccess.go +++ b/internal/server/instituteaccess.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/jwijenbergh/eduvpn-common/internal/fsm" - "github.com/jwijenbergh/eduvpn-common/internal/log" "github.com/jwijenbergh/eduvpn-common/internal/oauth" "github.com/jwijenbergh/eduvpn-common/internal/types" ) @@ -38,19 +37,18 @@ func (institute *InstituteAccessServer) GetBase() (*ServerBase, error) { return &institute.Base, nil } -func (institute *InstituteAccessServer) init(url string, displayName map[string]string, serverType string, supportContact []string, fsm *fsm.FSM, logger *log.FileLogger) error { +func (institute *InstituteAccessServer) init(url string, displayName map[string]string, serverType string, supportContact []string, fsm *fsm.FSM) error { errorMessage := fmt.Sprintf("failed initializing institute server %s", url) institute.Base.URL = url institute.Base.DisplayName = displayName institute.Base.SupportContact = supportContact institute.Base.FSM = fsm - institute.Base.Logger = logger institute.Base.Type = serverType endpoints, endpointsErr := APIGetEndpoints(url) if endpointsErr != nil { return &types.WrappedErrorMessage{Message: errorMessage, Err: endpointsErr} } - institute.OAuth.Init(endpoints.API.V3.Authorization, endpoints.API.V3.Token, fsm, logger) + institute.OAuth.Init(endpoints.API.V3.Authorization, endpoints.API.V3.Token, fsm) institute.Base.Endpoints = *endpoints return nil } -- cgit v1.2.3