Add configurable proxy command logging.

This commit adds a config switch that allows users to turn off
 the logging of proxy commands. It is set to off by default to
 prevent unwanted log spam and keep current behaviour.
Log proxy commands

This commit changes the PluginManager to print a message to
console and the log when a proxy command is executed.
This may assist with debugging and miscellaneous
investigations.
This commit is contained in:
xxyy
2015-10-19 00:50:59 +02:00
committed by md_5
parent 013320fd9e
commit ba448b5670
3 changed files with 17 additions and 0 deletions

View File

@@ -40,6 +40,11 @@ public interface ProxyConfig
*/
boolean isOnlineMode();
/**
* Whether proxy commands are logged to the proxy log
*/
boolean isLogCommands();
/**
* Returns the player max.
*/

View File

@@ -159,6 +159,13 @@ public class PluginManager
{
if ( tabResults == null )
{
if ( proxy.getConfig().isLogCommands() )
{
proxy.getLogger().log( Level.INFO, "{0} executed command: /{1}", new Object[]
{
sender.getName(), commandLine
} );
}
command.execute( sender, args );
} else if ( commandLine.contains( " " ) && command instanceof TabExecutor )
{