only log stack traces to openhab.log if debug is enabled (#9427)

Signed-off-by: Rob Nielsen <rob.nielsen@yahoo.com>
This commit is contained in:
robnielsen 2020-12-19 13:18:10 -06:00 committed by GitHub
parent 6b888b3492
commit 4409cf63c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -173,7 +173,11 @@ public class NetatmoBridgeHandler extends BaseBridgeHandler {
"Unable to connect Netatmo API : " + e.getLocalizedMessage()); "Unable to connect Netatmo API : " + e.getLocalizedMessage());
} }
} catch (RuntimeException e) { } catch (RuntimeException e) {
logger.warn("Unable to connect Netatmo API : {}", e.getMessage(), e); if (logger.isDebugEnabled()) {
logger.warn("Unable to connect Netatmo API : {}", e.getMessage(), e);
} else {
logger.warn("Unable to connect Netatmo API : {}", e.getMessage());
}
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Netatmo Access Failed, will retry in " + configuration.reconnectInterval + " seconds."); "Netatmo Access Failed, will retry in " + configuration.reconnectInterval + " seconds.");
} }

View File

@ -199,7 +199,11 @@ public class CloudClient {
}).on(Socket.EVENT_ERROR, new Emitter.Listener() { }).on(Socket.EVENT_ERROR, new Emitter.Listener() {
@Override @Override
public void call(Object... args) { public void call(Object... args) {
logger.error("Error connecting to the openHAB Cloud instance: {}", args[0]); if (logger.isDebugEnabled()) {
logger.error("Error connecting to the openHAB Cloud instance: {}", args[0]);
} else {
logger.error("Error connecting to the openHAB Cloud instance");
}
} }
}).on("request", new Emitter.Listener() { }).on("request", new Emitter.Listener() {
@Override @Override