File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import SWProxy
55import threading
66import logging
7+ import time
78
89logger = logging .getLogger ("SWProxy" )
910
@@ -51,6 +52,10 @@ def openPCAP(self):
5152 def log (self , str ):
5253 self .ui .logWindow .addItem (str )
5354
55+ # After a short delay, scroll to the bottom of the window.
56+ # Cannot scroll immediately due to race condition with UI update
57+ threading .Timer (0.1 , self .ui .logWindow .scrollToBottom ).start ()
58+
5459 def startStopProxy (self ):
5560 self .ui .proxyPort .setReadOnly (True )
5661 if self .proxy :
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ def parse_pcap(filename):
233233
234234 # Set up logger
235235 level = "DEBUG" if options .debug else "INFO"
236- logging .basicConfig (level = level , filename = "proxy.log" , format = ' %(asctime)s: %(name)s - %(levelname)s - %(message)s' )
236+ logging .basicConfig (level = level , filename = "proxy.log" , format = " %(asctime)s: %(name)s - %(levelname)s - %(message)s" )
237237 logger .setLevel (logging .INFO )
238238
239239 print get_usage_text ()
@@ -264,6 +264,8 @@ def parse_pcap(filename):
264264 app_icon .addFile (icons_path + '256x256.png' , QSize (256 ,256 ))
265265 app .setWindowIcon (app_icon )
266266 win = gui .MainWindow (get_external_ip (), options .port )
267- logger .addHandler (gui .GuiLogHandler (win ))
267+ guiLogHandler = gui .GuiLogHandler (win )
268+ guiLogHandler .setFormatter (logging .Formatter (fmt = "%(asctime)s %(message)s" , datefmt = "%X" ))
269+ logger .addHandler (guiLogHandler )
268270 win .show ()
269271 sys .exit (app .exec_ ())
Original file line number Diff line number Diff line change 55
66class DemoPlugin (SWPlugin .SWPlugin ):
77 def process_request (self , req_json , resp_json ):
8- logger .info ("Found Summoners War API request : %s " % req_json [ 'command' ] )
8+ logger .info ("Found Summoners War API request (wizard_id : %(wizard_id)s) : %(command)s " % req_json )
You can’t perform that action at this time.
0 commit comments