From d8e466712a4c5af17c27953b38f1b4e7d914d5cf Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 27 Sep 2022 14:00:32 +0200 Subject: Log: Add 'inherit' that sets the error level as the log level --- state.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'state.go') diff --git a/state.go b/state.go index 4e9f10e..940ba37 100644 --- a/state.go +++ b/state.go @@ -478,7 +478,8 @@ func (state *VPNState) GetConfigSecureInternet( config, configType, configErr := state.getConfig(server, forceTCP) if configErr != nil { - state.Logger.Error( + state.Logger.Inherit( + configErr, fmt.Sprintf( "Failed getting a secure internet configuration with error: %s", GetErrorTraceback(configErr), @@ -548,7 +549,7 @@ func (state *VPNState) GetConfigInstituteAccess(url string, forceTCP bool) (stri config, configType, configErr := state.getConfig(server, forceTCP) if configErr != nil { - state.Logger.Error( + state.Logger.Inherit(configErr, fmt.Sprintf( "Failed getting an institute access server configuration with error: %s", GetErrorTraceback(configErr), @@ -577,7 +578,8 @@ func (state *VPNState) GetConfigCustomServer(url string, forceTCP bool) (string, config, configType, configErr := state.getConfig(server, forceTCP) if configErr != nil { - state.Logger.Error( + state.Logger.Inherit( + configErr, fmt.Sprintf( "Failed getting a custom server with error: %s", GetErrorTraceback(configErr), -- cgit v1.2.3