From 5ffd0a395f7ef61b75b6ef4b625e78da7900e249 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Thu, 5 Jan 2023 17:25:33 +0100 Subject: Logger: Do not interpret error string as format specifier argument --- client/client.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/client.go b/client/client.go index b37c506..6dae665 100644 --- a/client/client.go +++ b/client/client.go @@ -2,6 +2,7 @@ package client import ( + "fmt" "strings" "github.com/eduvpn/eduvpn-common/internal/config" @@ -24,9 +25,9 @@ type ( func (c *Client) logError(err error) { // Logs the error with the same level/verbosity as the error if c.Debug { - c.Logger.Inheritf(err, "\nwith stacktrace: %s\n", err.(*errors.Error).ErrorStack()) + c.Logger.Inherit(err, fmt.Sprintf("\nwith stacktrace: %s\n", err.(*errors.Error).ErrorStack())) } else { - c.Logger.Inheritf(err, "") + c.Logger.Inherit(err, "") } } -- cgit v1.2.3