def test_file_rotation(self, mock_get_now): mock_get_now = mock.Mock.return_value = datetime.datetime(1960, 1, 1, 8, 10, 10) wlogger.setup_loggers(os.path.join(self.test_data_dir, 'Temp'), debug_on=True, test_mode_on=True, name='test_file_rotation', maxBytes=1000) for i in range(0, 1000): wlogger.log_info('Info Message ' + str(i), name='test_file_rotation') wlogger.log_debug('Debug Message ' + str(i), name='test_file_rotation') wlogger.log_error('Error Message ' + str(i), name='test_file_rotation') wlogger.tear_down_loggers(name='test_file_rotation') self.log_test_compare()
def test_message_levels_debug_off(self, mock_get_now): mock_get_now = mock.Mock.return_value = datetime.datetime(1960, 1, 1, 8, 10, 10) wlogger.setup_loggers(os.path.join(self.test_data_dir, 'Temp'), debug_on=False, test_mode_on=True, name='test_message_levels_debug_off') wlogger.log_info('Info Message', name='test_message_levels_debug_off') wlogger.log_debug('Debug Message', name='test_message_levels_debug_off') wlogger.log_error('Error Message', name='test_message_levels_debug_off') wlogger.log_info('Info Message', name='test_message_levels_debug_off') wlogger.log_debug('Debug Message', name='test_message_levels_debug_off') wlogger.log_warning('Warning Message', name='test_message_levels_debug_off') wlogger.tear_down_loggers(name='test_message_levels_debug_off') self.log_test_compare()
wlogger.log_info("Begin Cycle") myController.straight_to_point(stepSize, [60, 0]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, [-60, 0]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, [-48, 48]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, [48, -48]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, [-48, -48]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, resting) time.sleep(random.randint(2, 8)) myController.Low_Cross_Eyes(stepSize) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, resting) time.sleep(random.randint(2, 8)) #myController.Straight_Eye_Roll(stepSize) myController.straight_to_point(stepSize, [60, 0, -60, 0]) time.sleep(random.randint(2, 8)) myController.straight_to_point(stepSize, resting) time.sleep(random.randint(2, 8)) except Exception as e: # Just print(e) is cleaner and more likely what you want, # but if you insist on printing message specifically whenever possible... print(e) wlogger.log_error(e) raise