Remove debug log spam from hot path entirely
Some checks failed
Release Drafter / update_release_draft (push) Failing after 4s
Some checks failed
Release Drafter / update_release_draft (push) Failing after 4s
The conditional config.debuglogging checks were not working reliably in node_helper context. Removed debug logging from onStateChangedEvent entirely (it fires on every entity state change - multiple times per second for power sensors). WS disconnect promoted to info level since it's actually useful.
This commit is contained in:
@@ -224,14 +224,8 @@ async function reconnectWebsocket(payload) {
|
||||
}
|
||||
|
||||
function onStateChangedEvent(event) {
|
||||
if (config.debuglogging) {
|
||||
this.logger.debug(`Got state change for ${event.data.entity_id}`);
|
||||
}
|
||||
for (const connection in this.connections) {
|
||||
if (this.connections[connection].entities.includes(event.data.entity_id)) {
|
||||
if (config.debuglogging) {
|
||||
this.logger.debug(`Found listening connection (${connection}) for entity ${event.data.entity_id}`);
|
||||
}
|
||||
this.sendSocketNotification("CHANGED_STATE", {
|
||||
identifier: connection,
|
||||
cause: event.data.entity_id,
|
||||
@@ -243,9 +237,7 @@ function onStateChangedEvent(event) {
|
||||
function onWebsocketCloseEvent(event) {
|
||||
for (const connection in this.connections) {
|
||||
if (event.target == this.connections[connection].websocket.rawClient.ws) {
|
||||
if (config.debuglogging) {
|
||||
this.logger.debug(`Hass WS Disconnected (${connection})`);
|
||||
}
|
||||
this.logger.info(`Hass WS Disconnected (${connection})`);
|
||||
this.sendSocketNotification("HASSWS_DISCONNECTED", {
|
||||
identifier: connection,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user