Skip to content

Commit

Permalink
Log a warning when a configured notifier is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
jcgay committed Aug 16, 2017
1 parent c37e1d4 commit 4e227b4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import fr.jcgay.notification.notifier.systemtray.SystemTrayNotifier;
import fr.jcgay.notification.notifier.toaster.ToasterConfiguration;
import fr.jcgay.notification.notifier.toaster.ToasterNotifier;
import org.slf4j.Logger;

import java.util.LinkedHashSet;
import java.util.Properties;
Expand All @@ -39,9 +40,12 @@
import static fr.jcgay.notification.notifier.growl.GntpSlf4jListener.DEBUG;
import static fr.jcgay.notification.notifier.growl.GntpSlf4jListener.ERROR;
import static java.util.Collections.unmodifiableSet;
import static org.slf4j.LoggerFactory.getLogger;

class NotifierProvider {

private static final Logger LOGGER = getLogger(NotifierProvider.class);

private static final ChosenNotifiers GROWL = ChosenNotifiers.from("growl");
private static final ChosenNotifiers NOTIFICATION_CENTER = ChosenNotifiers.from("notificationcenter");
private static final ChosenNotifiers NOTIFY_SEND = ChosenNotifiers.from("notifysend");
Expand Down Expand Up @@ -120,6 +124,7 @@ public DiscoverableNotifier byName(ChosenNotifiers notifier, Properties properti
return new SlackNotifier(application, SlackConfiguration.create(properties));
}

LOGGER.warn("Your configured notifier [{}] does not exist. Visit https://github.com/jcgay/send-notification/wiki#configuration to select an existing notifier.", notifier);
return DoNothingNotifier.doNothing();
}

Expand Down

0 comments on commit 4e227b4

Please sign in to comment.