Skip to content

Commit

Permalink
use logger for prints so we see them in log
Browse files Browse the repository at this point in the history
  • Loading branch information
maltfield committed Jul 27, 2024
1 parent 549483d commit e39d50d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/packages/buskill/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1027,9 +1027,9 @@ def toggle(self):
msg = "DEBUG: 5"; print( msg ); logger.error( msg ) # TODO: remove me

# TODO: remove prints
print( "usb_handler._exception:|" +str(self.usb_handler._exception)+ "|" )
msg = "usb_handler._exception:|" +str(self.usb_handler._exception)+ "|"; print(msg); logger.debug(msg)
msg = "DEBUG: 6"; print( msg ); logger.error( msg ) # TODO: remove me
print( "usb_handler.status:|" +str(self.usb_handler.status)+ "|" )
msg = "usb_handler.status:|" +str(self.usb_handler.status)+ "|"; print(msg); logger.debug(msg)
msg = "DEBUG: 7"; print( msg ); logger.error( msg ) # TODO: remove me

# did the child process throw an exception?
Expand All @@ -1048,16 +1048,16 @@ def toggle(self):
# the GUI to indicate that we're armed successfully
break

# # how much time has passed since we've been looping?
# current = time.time()
# if (current - start) > 0.1:
# # we've been waiting for more than 0.1 seconds; exit with error
#
# msg = "ERROR: timeout waiting for usb handler child process"
# print( msg ); logger.error( msg )
#
# # raise an error to be caught by the UI
# raise ChildProcessError(msg)
# how much time has passed since we've been looping?
current = time.time()
if (current - start) > 0.1:
# we've been waiting for more than 0.1 seconds; exit with error

msg = "ERROR: timeout waiting for usb handler child process"
print( msg ); logger.error( msg )

# raise an error to be caught by the UI
raise ChildProcessError(msg)

self.is_armed = True
msg = "INFO: BusKill is armed. Listening for removal event.\n"
Expand Down

0 comments on commit e39d50d

Please sign in to comment.