From 809ee6ffdb29e227251b065ad419262ed1dea88e Mon Sep 17 00:00:00 2001 From: robnielsen Date: Tue, 22 Dec 2020 21:51:22 -0600 Subject: [PATCH] [ecobee] only log stack traces to openhab.log if debug is enabled (#9443) Signed-off-by: Rob Nielsen --- .../binding/ecobee/internal/api/EcobeeApi.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/api/EcobeeApi.java b/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/api/EcobeeApi.java index 45e91b0b0a2be..b59a3827d4ca7 100644 --- a/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/api/EcobeeApi.java +++ b/bundles/org.openhab.binding.ecobee/src/main/java/org/openhab/binding/ecobee/internal/api/EcobeeApi.java @@ -167,9 +167,18 @@ private boolean isAuthorized() { accessTokenResponse = localAccessTokenResponse; ecobeeAuth.doAuthorization(); } catch (OAuthException | IOException | RuntimeException e) { - logger.info("API: Got exception trying to get access token from OAuth service", e); + if (logger.isDebugEnabled()) { + logger.info("API: Got exception trying to get access token from OAuth service", e); + } else { + logger.info("API: Got {} trying to get access token from OAuth service: {}", + e.getClass().getSimpleName(), e.getMessage()); + } } catch (EcobeeAuthException e) { - logger.info("API: The Ecobee authorization process threw an exception", e); + if (logger.isDebugEnabled()) { + logger.info("API: The Ecobee authorization process threw an exception", e); + } else { + logger.info("API: The Ecobee authorization process threw an exception: {}", e.getMessage()); + } ecobeeAuth.setState(EcobeeAuthState.NEED_PIN); } catch (OAuthResponseException e) { handleOAuthException(e);