Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Sonos: adjust log levels #4864

Merged
merged 1 commit into from
Jan 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
getCoordinatorHandler().stop();
}
} catch (IllegalStateException e) {
logger.warn("Cannot handle stop command ({})", e.getMessage());
logger.debug("Cannot handle stop command ({})", e.getMessage());
}
break;
case VOLUME:
Expand Down Expand Up @@ -335,7 +335,7 @@ public void handleCommand(ChannelUID channelUID, Command command) {
// Rewind and Fast Forward are currently not implemented by the binding
}
} catch (IllegalStateException e) {
logger.warn("Cannot handle control command ({})", e.getMessage());
logger.debug("Cannot handle control command ({})", e.getMessage());
}
break;
case SLEEPTIMER:
Expand Down Expand Up @@ -539,7 +539,7 @@ private void dispatchOnAllGroupMembers(String variable, String value, String ser
memberHandler.onValueReceived(variable, value, service);
}
} catch (IllegalStateException e) {
logger.warn("Cannot update channel for group member ({})", e.getMessage());
logger.debug("Cannot update channel for group member ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -737,7 +737,7 @@ private void updateChannel(String channeldD, State state, boolean allGroup) {
memberHandler.updateState(channeldD, state);
}
} catch (IllegalStateException e) {
logger.warn("Cannot update channel for group member ({})", e.getMessage());
logger.debug("Cannot update channel for group member ({})", e.getMessage());
}
}
} else if (ThingStatus.ONLINE.equals(getThing().getStatus()) && isLinked(channeldD)) {
Expand Down Expand Up @@ -769,7 +769,7 @@ private void updateGroupCoordinator() {
try {
coordinatorHandler = getHandlerByName(getCoordinator());
} catch (IllegalStateException e) {
logger.warn("Cannot update the group coordinator ({})", e.getMessage());
logger.debug("Cannot update the group coordinator ({})", e.getMessage());
coordinatorHandler = null;
}
}
Expand Down Expand Up @@ -1085,7 +1085,7 @@ && hasValueChanged(albumArtURI, memberHandler.stateMap.get("CurrentAlbumArtURI")
}
}
} catch (IllegalStateException e) {
logger.warn("Cannot update media data for group member ({})", e.getMessage());
logger.debug("Cannot update media data for group member ({})", e.getMessage());
}
}
if (needsUpdating && handlerForImageUpdate != null) {
Expand Down Expand Up @@ -1301,7 +1301,7 @@ private Long getResultEntry(Map<String, String> resultInput, String requestedKey
try {
result = Long.valueOf(resultInput.get(requestedKey));
} catch (NumberFormatException ex) {
logger.warn("Could not fetch {} result for type: {} and filter: {}. Using default value '0': {}",
logger.debug("Could not fetch {} result for type: {} and filter: {}. Using default value '0': {}",
requestedKey, entriesType, entriesFilter, ex.getMessage(), ex);
}

Expand Down Expand Up @@ -1497,7 +1497,7 @@ public void setVolumeForGroup(Command command) {
try {
getCoordinatorHandler().setVolume(command);
} catch (IllegalStateException e) {
logger.warn("Cannot set group volume ({})", e.getMessage());
logger.debug("Cannot set group volume ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -1597,7 +1597,7 @@ public void addURIToQueue(String URI, String meta, long desiredFirstTrack, boole
inputs.put("DesiredFirstTrackNumberEnqueued", Long.toString(desiredFirstTrack));
inputs.put("EnqueueAsNext", Boolean.toString(enqueueAsNext));
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
logger.debug("Action Invalid Value Format Exception {}", ex.getMessage());
}

Map<String, String> result = service.invokeAction(this, "AVTransport", "AddURIToQueue", inputs);
Expand All @@ -1621,7 +1621,7 @@ public void setCurrentURI(String URI, String URIMetaData) {
inputs.put("CurrentURI", URI);
inputs.put("CurrentURIMetaData", URIMetaData);
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
logger.debug("Action Invalid Value Format Exception {}", ex.getMessage());
}

Map<String, String> result = service.invokeAction(this, "AVTransport", "SetAVTransportURI", inputs);
Expand Down Expand Up @@ -1653,7 +1653,7 @@ protected void seek(String unit, String target) {
inputs.put("Unit", unit);
inputs.put("Target", target);
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
logger.debug("Action Invalid Value Format Exception {}", ex.getMessage());
}

Map<String, String> result = service.invokeAction(this, "AVTransport", "Seek", inputs);
Expand Down Expand Up @@ -1725,7 +1725,7 @@ public void setShuffle(Command command) {
}
}
} catch (IllegalStateException e) {
logger.warn("Cannot handle shuffle command ({})", e.getMessage());
logger.debug("Cannot handle shuffle command ({})", e.getMessage());
}
}
}
Expand All @@ -1746,12 +1746,12 @@ public void setRepeat(Command command) {
coordinator.updatePlayMode(coordinator.isShuffleActive() ? "SHUFFLE_NOREPEAT" : "NORMAL");
break;
default:
logger.warn("{}: unexpected repeat command; accepted values are ALL, ONE and OFF",
logger.debug("{}: unexpected repeat command; accepted values are ALL, ONE and OFF",
command.toString());
break;
}
} catch (IllegalStateException e) {
logger.warn("Cannot handle repeat command ({})", e.getMessage());
logger.debug("Cannot handle repeat command ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -1841,10 +1841,10 @@ public void playLineIn(Command command) {
// start jammin'
coordinatorHandler.play();
} else {
logger.warn("Line-in of {} is not connected", remoteHandler.getUDN());
logger.debug("Line-in of {} is not connected", remoteHandler.getUDN());
}
} catch (IllegalStateException e) {
logger.warn("Cannot play line-in ({})", e.getMessage());
logger.debug("Cannot play line-in ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -1976,7 +1976,7 @@ public void updateAlarm(SonosAlarm alarm) {
inputs.put("Enabled", "0");
}
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
logger.debug("Action Invalid Value Format Exception {}", ex.getMessage());
}

Map<String, String> result = service.invokeAction(this, "AlarmClock", "UpdateAlarm", inputs);
Expand Down Expand Up @@ -2011,7 +2011,7 @@ public void setAlarm(boolean alarmSwitch) {
try {
currentDateTime = fmt.parse(currentLocalTime);
} catch (ParseException e) {
logger.error("An exception occurred while formatting a date", e);
logger.debug("An exception occurred while formatting a date", e);
}

if (currentDateTime != null) {
Expand All @@ -2030,7 +2030,7 @@ public void setAlarm(boolean alarmSwitch) {
try {
durationDate = durationFormat.parse(anAlarm.getDuration());
} catch (ParseException e) {
logger.error("An exception occurred while parsing a date : '{}'", e.getMessage());
logger.debug("An exception occurred while parsing a date : '{}'", e.getMessage());
continue;
}

Expand Down Expand Up @@ -2080,7 +2080,7 @@ public void snoozeAlarm(Command command) {
try {
inputs.put("Duration", pFormatter.format(snoozePeriod.getTime()));
} catch (NumberFormatException ex) {
logger.error("Action Invalid Value Format Exception {}", ex.getMessage());
logger.debug("Action Invalid Value Format Exception {}", ex.getMessage());
}

Map<String, String> result = service.invokeAction(this, "AVTransport", "SnoozeAlarm", inputs);
Expand All @@ -2089,7 +2089,7 @@ public void snoozeAlarm(Command command) {
this.onValueReceived(variable, result.get(variable), "AVTransport");
}
} else {
logger.warn("There is no alarm running on {}", getUDN());
logger.debug("There is no alarm running on {}", getUDN());
}
}

Expand Down Expand Up @@ -2118,7 +2118,7 @@ public void addMember(Command command) {
try {
getHandlerByName(command.toString()).setCurrentURI(entry);
} catch (IllegalStateException e) {
logger.warn("Cannot add group member ({})", e.getMessage());
logger.debug("Cannot add group member ({})", e.getMessage());
}
}
}
Expand All @@ -2145,7 +2145,7 @@ public boolean publicAddress() {
addMember(StringType.valueOf(somePlayer.getUDN()));
}
} catch (IllegalStateException e) {
logger.warn("Cannot add to group ({})", e.getMessage());
logger.debug("Cannot add to group ({})", e.getMessage());
}
}
}
Expand All @@ -2162,11 +2162,11 @@ public boolean publicAddress() {

return true;
} catch (IllegalStateException e) {
logger.warn("Cannot handle command ({})", e.getMessage());
logger.debug("Cannot handle command ({})", e.getMessage());
return false;
}
} else {
logger.warn("Line-in of {} is not connected", getUDN());
logger.debug("Line-in of {} is not connected", getUDN());
return false;
}
}
Expand Down Expand Up @@ -2208,7 +2208,7 @@ public void playURI(Command command) {
// start jammin'
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play URI ({})", e.getMessage());
logger.debug("Cannot play URI ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -2250,7 +2250,7 @@ public void playNotificationSoundURI(Command notificationURL) {
notificationLock.notify();
}
} catch (IllegalStateException e) {
logger.warn("Cannot play sound ({})", e.getMessage());
logger.debug("Cannot play sound ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -2429,7 +2429,7 @@ private void waitForFinishedNotification() {
break;
}
} catch (InterruptedException e) {
logger.error("InterruptedException during playing a notification sound");
logger.debug("InterruptedException during playing a notification sound");
}
}
}
Expand All @@ -2444,7 +2444,7 @@ private void waitForTransportState(String state) {
break;
}
} catch (InterruptedException e) {
logger.error("InterruptedException during playing a notification sound");
logger.debug("InterruptedException during playing a notification sound");
}
}
}
Expand All @@ -2460,7 +2460,7 @@ private void waitForNotTransportState(String state) {
break;
}
} catch (InterruptedException e) {
logger.error("InterruptedException during playing a notification sound");
logger.debug("InterruptedException during playing a notification sound");
}
}
}
Expand Down Expand Up @@ -2499,7 +2499,7 @@ public void clearQueue() {

coordinator.removeAllTracksFromQueue();
} catch (IllegalStateException e) {
logger.warn("Cannot clear queue ({})", e.getMessage());
logger.debug("Cannot clear queue ({})", e.getMessage());
}
}

Expand All @@ -2516,7 +2516,7 @@ public void playQueue() {
// start jammin'
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play queue ({})", e.getMessage());
logger.debug("Cannot play queue ({})", e.getMessage());
}
}

Expand Down Expand Up @@ -2555,7 +2555,7 @@ public void removeMember(Command command) {
QUEUE_URI + oldmemberHandler.getUDN() + "#0");
oldmemberHandler.setCurrentURI(entry);
} catch (IllegalStateException e) {
logger.warn("Cannot remove group member ({})", e.getMessage());
logger.debug("Cannot remove group member ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -2597,10 +2597,10 @@ public void playRadio(Command command) {
coordinator.setCurrentURI(theEntry);
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play radio ({})", e.getMessage());
logger.debug("Cannot play radio ({})", e.getMessage());
}
} else {
logger.warn("Radio station '{}' not found", station);
logger.debug("Radio station '{}' not found", station);
}
}
}
Expand Down Expand Up @@ -2632,10 +2632,10 @@ public void playTuneinStation(Command command) {
coordinator.setCurrentURI(entry);
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play TuneIn station {} ({})", stationId, e.getMessage());
logger.debug("Cannot play TuneIn station {} ({})", stationId, e.getMessage());
}
} else {
logger.warn("TuneIn service not found");
logger.debug("TuneIn service not found");
}
}
}
Expand Down Expand Up @@ -2723,10 +2723,10 @@ public void playFavorite(Command command) {
}
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot paly favorite ({})", e.getMessage());
logger.debug("Cannot paly favorite ({})", e.getMessage());
}
} else {
logger.warn("Favorite '{}' not found", favorite);
logger.debug("Favorite '{}' not found", favorite);
}
}
}
Expand All @@ -2749,7 +2749,7 @@ public void playTrack(Command command) {
// start jammin'
coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play track ({})", e.getMessage());
logger.debug("Cannot play track ({})", e.getMessage());
}
}
}
Expand Down Expand Up @@ -2784,10 +2784,10 @@ public void playPlayList(Command command) {

coordinator.play();
} catch (IllegalStateException e) {
logger.warn("Cannot play playlist ({})", e.getMessage());
logger.debug("Cannot play playlist ({})", e.getMessage());
}
} else {
logger.warn("Playlist '{}' not found", playlist);
logger.debug("Playlist '{}' not found", playlist);
}
}
}
Expand Down Expand Up @@ -2905,7 +2905,7 @@ private String sleepSecondsToTimeStr(long sleepSeconds) {
long seconds = TimeUnit.SECONDS.toSeconds(remainingSeconds);
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
} else {
logger.error("Sonos SleepTimer: Invalid sleep time set. sleep time must be >=0 and < 68400s (24h)");
logger.debug("Sonos SleepTimer: Invalid sleep time set. sleep time must be >=0 and < 68400s (24h)");
return "ERR";
}
}
Expand Down