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:
parent
013320fd9e
commit
ba448b5670
@ -40,6 +40,11 @@ public interface ProxyConfig
|
||||
*/
|
||||
boolean isOnlineMode();
|
||||
|
||||
/**
|
||||
* Whether proxy commands are logged to the proxy log
|
||||
*/
|
||||
boolean isLogCommands();
|
||||
|
||||
/**
|
||||
* Returns the player max.
|
||||
*/
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -47,6 +47,10 @@ public class Configuration implements ProxyConfig
|
||||
* Should we check minecraft.net auth.
|
||||
*/
|
||||
private boolean onlineMode = true;
|
||||
/**
|
||||
* Whether we log proxy commands to the proxy log
|
||||
*/
|
||||
private boolean logCommands;
|
||||
private int playerLimit = -1;
|
||||
private Collection<String> disabledCommands;
|
||||
private int throttle = 4000;
|
||||
@ -75,6 +79,7 @@ public class Configuration implements ProxyConfig
|
||||
timeout = adapter.getInt( "timeout", timeout );
|
||||
uuid = adapter.getString( "stats", uuid );
|
||||
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
||||
logCommands = adapter.getBoolean( "log_commands", logCommands );
|
||||
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
||||
throttle = adapter.getInt( "connection_throttle", throttle );
|
||||
ipForward = adapter.getBoolean( "ip_forward", ipForward );
|
||||
|
Loading…
Reference in New Issue
Block a user