def run_server(server_host, server_port, debug_mode): """ Launches a statistics server if the server_host (as a host name or IP address) evaluates to this server. Returns without action if the server_host appears to refer to a different server, or if a server process is already running. server_host - the name or IP address of the stats server server_port - the port number that the stats server will listen on debug_mode - whether to run the stats server in debug mode Statistics can be disabled by providing an empty string for server_host and/or 0 for the port number. """ if server_host and (server_port > 0) and this_is_computer(server_host): stats_server.run_server_process(debug_mode)
def run_server(server_host, server_port, log_filename, debug_mode): """ Launches a logging server if the server_host (as a host name or IP address) evaluates to this server. Returns without action if the server_host appears to refer to a different server, or if a logging server process is already running. server_host - the name or IP address of the logging server server_port - the port number that the logging server will listen on log_filename - the log filename that the logging server will create debug_mode - a boolean for whether to log additional information Logging can be disabled by providing an empty string for server_host and/or 0 for the port number. """ if server_host and (server_port > 0) and this_is_computer(server_host): log_server.run_server_process(log_filename, debug_mode)