try {
command = "" + command.substring(SkriptConfig.effectCommandToken.value().length()).trim();
final RetainingLogHandler log = SkriptLogger.startRetainingLog();
try {
ScriptLoader.setCurrentEvent("effect command", EffectCommandEvent.class);
final Effect e = Effect.parse(command, null);
ScriptLoader.deleteCurrentEvent();
if (e != null) {
log.clear(); // ignore warnings and stuff
log.printLog();
sender.sendMessage(ChatColor.GRAY + "executing '" + ChatColor.stripColor(command) + "'");
if (SkriptConfig.logPlayerCommands.value() && !(sender instanceof ConsoleCommandSender))
Skript.info(sender.getName() + " issued effect command: " + command);
e.run(new EffectCommandEvent(sender, command));
} else {
if (sender == Bukkit.getConsoleSender()) // log as SEVERE instead of INFO like printErrors below
SkriptLogger.LOGGER.severe("Error in: " + ChatColor.stripColor(command));
else
sender.sendMessage(ChatColor.RED + "Error in: " + ChatColor.GRAY + ChatColor.stripColor(command));