add item name to ScriptBusEvent log messages (#2503)

Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
pull/2502/head
J-N-K 2021-10-03 22:15:18 +02:00 committed by GitHub
parent 338204341b
commit 1d17166c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -94,7 +94,8 @@ public class ScriptBusEvent {
if (command != null) {
eventPublisher.post(ItemEventFactory.createCommandEvent(itemName, command));
} else {
LoggerFactory.getLogger(ScriptBusEvent.class).warn("Command '{}' cannot be parsed.", commandString);
LoggerFactory.getLogger(ScriptBusEvent.class).warn("Command '{}' cannot be parsed for item '{}'.",
commandString, item);
}
} catch (ItemNotFoundException e) {
LoggerFactory.getLogger(ScriptBusEvent.class).warn("Item '{}' does not exist.", itemName);
@ -158,7 +159,8 @@ public class ScriptBusEvent {
if (state != null) {
eventPublisher.post(ItemEventFactory.createStateEvent(itemName, state));
} else {
LoggerFactory.getLogger(ScriptBusEvent.class).warn("State '{}' cannot be parsed.", stateString);
LoggerFactory.getLogger(ScriptBusEvent.class).warn("State '{}' cannot be parsed for item '{}'.",
stateString, itemName);
}
} catch (ItemNotFoundException e) {
LoggerFactory.getLogger(ScriptBusEvent.class).warn("Item '{}' does not exist.", itemName);