Commits

German Larrain  committed d0a3029

app: replaced prints to console with logging

  • Participants
  • Parent commits d782db5

Comments (0)

Files changed (1)

File ars/app/__init__.py

 		a new simulation.
 
 		"""
-		if self.PRINT_KEY_INFO:
-			print("reset simulation")
+		logger.info("reset simulation")
+
 		self.do_create_window = True
 		self.gAdapter.reset()
 		self.create_simulation()
 
 	def on_action_selection(self, key):
 		"""Method called after an actions is selected by pressing a key."""
-		if self.PRINT_KEY_INFO:
-			print(key)
+		logger.info("key: %s" % key)
+
 		try:
 			if self.key_press_functions.has_key(key):
 				if self.key_press_functions.is_repeat(key):
 				else:
 					self.key_press_functions.call(key)
 			else:
-				if self.PRINT_KEY_INFO:
-					print('unregistered key: %s' % key)
-		except Exception as ex:
-			print(ex)
+				logger.info("unregistered key: %s" % key)
+		except Exception:
+			logger.exception("")
 
 	#==========================================================================
 	# other
 	def call(self, key):
 		try:
 			self._map[key][0]()
-		except Exception as ex:
-			print(ex)
+		except Exception:
+			logger.exception("")
 
 	def is_repeat(self, key):
 		return self._map.get(key)[1]