Log to console the effects of /sudo

This commit is contained in:
KHobbits 2012-09-08 21:10:26 +01:00
parent 8c4d6ad4df
commit 78a580bc40
2 changed files with 16 additions and 4 deletions

View File

@ -110,8 +110,6 @@ public interface ISettings extends IConf
boolean showNonEssCommandsInHelp();
boolean spawnIfNoHome();
boolean warnOnBuildDisallow();
boolean warnOnSmite();

View File

@ -2,6 +2,8 @@ package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
@ -13,6 +15,7 @@ public class Commandsudo extends EssentialsCommand
{
super("sudo");
}
private static final Logger LOGGER = Logger.getLogger("Minecraft");
@Override
public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
@ -40,8 +43,19 @@ public class Commandsudo extends EssentialsCommand
final PluginCommand execCommand = ess.getServer().getPluginCommand(command);
if (execCommand != null)
{
execCommand.execute(user.getBase(), command, arguments);
ess.scheduleSyncDelayedTask(
new Runnable()
{
@Override
public void run()
{
LOGGER.log(Level.INFO, String.format("[Sudo] %s issued server command: /%s %s", user.getName(), command, getFinalArg(arguments, 0)));
execCommand.execute(user.getBase(), command, arguments);
}
});
}
else {
sender.sendMessage(_("errorCallingCommand", command));
}
}
}