summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-12-14 12:35:23 +0100
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-12-14 15:41:39 +0100
commitcc622226c57351703d0bdb3e32659d70a7ca9e7c (patch)
tree90aebcbb6d14f821eb7191a114703a04a37a98e6
parente1cc6375180bf75ae8a7831fc72c27c03191ce61 (diff)
Client: If debug, log with stacktrace
-rw-r--r--client/client.go6
1 files changed, 5 insertions, 1 deletions
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 {