From cc622226c57351703d0bdb3e32659d70a7ca9e7c Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 14 Dec 2022 12:35:23 +0100 Subject: Client: If debug, log with stacktrace --- client/client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/client.go b/client/client.go index a11bf4e..a31334a 100644 --- a/client/client.go +++ b/client/client.go @@ -22,7 +22,11 @@ type ( func (c *Client) logError(err error) { // Logs the error with the same level/verbosity as the error - c.Logger.Inherit(err) + if c.Debug { + c.Logger.Inheritf(err, "\nwith stacktrace: %s\n", err.(*errors.Error).ErrorStack()) + } else { + c.Logger.Inheritf(err, "") + } } func (c *Client) isLetsConnect() bool { -- cgit v1.2.3