Skip to content

Commit

Permalink
fixed logger error stacktraces
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Oct 11, 2018
1 parent 8e92d7f commit 8d4a349
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/carpet/commands/LogCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ private static int unsubFromLogger(CommandSource source, String player_name, Str
Messenger.m(source, "r No player specified");
return 0;
}
Logger log = LoggerRegistry.getLogger(logname);
if (log == null)
if (LoggerRegistry.getLogger(logname) == null)
{
Messenger.m(source, "r Unknown logger: ","rb "+logname);
return 0;
Expand All @@ -172,6 +171,11 @@ private static int toggleSubscription(CommandSource source, String player_name,
Messenger.m(source, "r No player specified");
return 0;
}
if (LoggerRegistry.getLogger(logName) == null)
{
Messenger.m(source, "r Unknown logger: ","rb "+logName);
return 0;
}
boolean subscribed = LoggerRegistry.togglePlayerSubscription(player_name, logName);
if (subscribed)
{
Expand All @@ -191,6 +195,11 @@ private static int subscribePlayer(CommandSource source, String player_name, Str
Messenger.m(source, "r No player specified");
return 0;
}
if (LoggerRegistry.getLogger(logname) == null)
{
Messenger.m(source, "r Unknown logger: ","rb "+logname);
return 0;
}
LoggerRegistry.subscribePlayer(player_name, logname, option);
if (option!=null)
{
Expand Down

0 comments on commit 8d4a349

Please sign in to comment.