diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-14 12:35:23 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-12-14 15:41:39 +0100 |
| commit | cc622226c57351703d0bdb3e32659d70a7ca9e7c (patch) | |
| tree | 90aebcbb6d14f821eb7191a114703a04a37a98e6 /client | |
| parent | e1cc6375180bf75ae8a7831fc72c27c03191ce61 (diff) | |
Client: If debug, log with stacktrace
Diffstat (limited to 'client')
| -rw-r--r-- | client/client.go | 6 |
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 { |
