diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-20 16:07:13 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-20 16:07:13 +0200 |
| commit | 0c9a300a58d9dacce7b84ff93222eed35eab5721 (patch) | |
| tree | 423d1f05024f5c050e09f8d239f15b2e8681e640 /internal/server/instituteaccess.go | |
| parent | a1939a105dc4ddab27489b1bac3b22f674536e41 (diff) | |
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
Diffstat (limited to 'internal/server/instituteaccess.go')
| -rw-r--r-- | internal/server/instituteaccess.go | 6 |
1 files changed, 2 insertions, 4 deletions
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 } |
