mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #29329 -- Made datetime logging from runserver more consistent.
Setting default_msec_format=None will make it the same, unfortunately it's not supported by Python, see https://bugs.python.org/issue40300.
This commit is contained in:
		
				
					committed by
					
						 Mariusz Felisiak
						Mariusz Felisiak
					
				
			
			
				
	
			
			
			
						parent
						
							96c6f9c61c
						
					
				
				
					commit
					7b31ba541f
				
			| @@ -160,6 +160,8 @@ class RequireDebugTrue(logging.Filter): | ||||
|  | ||||
|  | ||||
| class ServerFormatter(logging.Formatter): | ||||
|     default_time_format = '%d/%b/%Y %H:%M:%S' | ||||
|  | ||||
|     def __init__(self, *args, **kwargs): | ||||
|         self.style = color_style() | ||||
|         super().__init__(*args, **kwargs) | ||||
|   | ||||
| @@ -605,4 +605,4 @@ class LogFormattersTests(SimpleTestCase): | ||||
|  | ||||
|         with patch_django_server_logger() as logger_output: | ||||
|             logger.info(log_msg) | ||||
|             self.assertRegex(logger_output.getvalue(), r'^\[[-:,.\s\d]+\] %s' % log_msg) | ||||
|             self.assertRegex(logger_output.getvalue(), r'^\[[/:,\w\s\d]+\] %s\n' % log_msg) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user