Skip to content
Snippets Groups Projects
Commit 2dcc31e8 authored by Mandeep Dhami's avatar Mandeep Dhami
Browse files

Fixed thread names to make logs easier to understand

parent 0ba0e8bb
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,7 @@ public class Server extends Thread {
this.locals = new HashMap<String, Object>();
}
this.locals.put("log", Server.log);
this.setName("debugserver");
}
/**
......
#!/usr/bin/env python
import sys
from threading import currentThread
from SocketServer import BaseRequestHandler, TCPServer
from code import InteractiveConsole
......@@ -37,7 +38,8 @@ class DebugConsole(InteractiveConsole):
class DebugServerHandler(BaseRequestHandler):
def __init__(self, request, client_address, server):
_log.debug('Open connection to DebugServer from: %s' % str(client_address))
currentThread()._thread.setName("debugserver-%s:%d" % client_address)
_log.debug('Open connection to DebugServer from %s:%d' % client_address)
BaseRequestHandler.__init__(self, request, client_address, server)
def handle(self):
......@@ -51,13 +53,14 @@ class DebugServer(TCPServer):
allow_reuse_address = True
def handle_error(self, request, client_address):
_log.debug('Closing connection to DebugServer from: %s' % str(client_address))
_log.debug('Closing connection to DebugServer from %s:%d' % client_address)
request.close()
def run_server(port=6655, host='0.0.0.0', locals=locals()):
currentThread()._thread.setName("debugserver-main")
global _locals
_locals = locals
if "log" in locals.keys():
global _log
_log = locals["log"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment