def test_access_log_plain_format(self):
        """Test the exact plain text format of access logs"""
        # Set up environment for plain format
        with patch.dict('os.environ', {
            'MARQO_LOG_LEVEL': 'info',
            'MARQO_LOG_FORMAT': 'plain'
        }):
            importlib.reload(marqo_logging)

            # Get the access logger and its handler
            access_logger = logging.getLogger('uvicorn.access')
            access_handler = access_logger.handlers[0]

            # Replace the stream object of the handler
            stream = io.StringIO()
            access_handler.stream = stream

            access_logger.info('%s - "%s %s HTTP/%s" %d',
                               "127.0.0.1:30000", "GET", "/?debug=true", "1.1", 200)

            # Verify output format
            output = stream.getvalue()
            self.assertRegex(output,
                             r'^\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}\] \d+ '
                             r'INFO 127.0.0.1:30000 - "GET /\?debug=true HTTP/1.1" 200 OK\n$')
Test the exact plain text format of access logs
tests/unit_tests/marqo/test_logging.py