diff --git a/azure_functions_worker/dispatcher.py b/azure_functions_worker/dispatcher.py index 04b144eb3..16f4da348 100644 --- a/azure_functions_worker/dispatcher.py +++ b/azure_functions_worker/dispatcher.py @@ -130,7 +130,9 @@ async def dispatch_forever(self): # established, should use it for system and user logs logging_handler = AsyncLoggingHandler() root_logger = logging.getLogger() - root_logger.setLevel(logging.DEBUG) + + # Don't change this unless you read #780 and #745 + root_logger.setLevel(logging.INFO) root_logger.addHandler(logging_handler) logger.info('Switched to gRPC logging.') logging_handler.flush() diff --git a/azure_functions_worker/testutils.py b/azure_functions_worker/testutils.py index a965b5cf6..c32ae467e 100644 --- a/azure_functions_worker/testutils.py +++ b/azure_functions_worker/testutils.py @@ -148,10 +148,11 @@ def wrapper(self, *args, __meth__=test_case, # Trim off host output timestamps host_output = getattr(self, 'host_out', '') output_lines = host_output.splitlines() - ts_re = r"^\[\d+\/\d+\/\d+ \d+\:\d+\:\d+.*(A|P)*M*\]" - output = list(map( - lambda s: re.sub(ts_re, '', s).strip(), - output_lines)) + ts_re = r"^\[\d+(\/|-)\d+(\/|-)\d+T*\d+\:\d+\:\d+.*(" \ + r"A|P)*M*\]" + output = list(map(lambda s: + re.sub(ts_re, '', s).strip(), + output_lines)) # Execute check_log_ test cases self._run_test(__check_log__, host_out=output) diff --git a/tests/unittests/test_http_functions.py b/tests/unittests/test_http_functions.py index 673035e19..ba047ef2e 100644 --- a/tests/unittests/test_http_functions.py +++ b/tests/unittests/test_http_functions.py @@ -5,6 +5,7 @@ import filecmp import typing import os +import unittest import pytest @@ -98,22 +99,34 @@ def check_log_async_logging(self, host_out: typing.List[str]): self.assertIn('hello info', host_out) self.assertIn('and another error', host_out) + @unittest.skip("Reverting the debug logs PR as host currently cannot handle" + "apps with lot of debug statements. Reverting PR: " + "azure-functions-python-worker/pull/745") def test_debug_logging(self): r = self.webhost.request('GET', 'debug_logging') self.assertEqual(r.status_code, 200) self.assertEqual(r.text, 'OK-debug') + @unittest.skip("Reverting the debug logs PR as host currently cannot handle" + "apps with lot of debug statements. Reverting PR: " + "azure-functions-python-worker/pull/745") def check_log_debug_logging(self, host_out: typing.List[str]): self.assertIn('logging info', host_out) self.assertIn('logging warning', host_out) self.assertIn('logging debug', host_out) self.assertIn('logging error', host_out) + @unittest.skip("Reverting the debug logs PR as host currently cannot handle" + "apps with lot of debug statements. Reverting PR: " + "azure-functions-python-worker/pull/745") def test_debug_with_user_logging(self): r = self.webhost.request('GET', 'debug_user_logging') self.assertEqual(r.status_code, 200) self.assertEqual(r.text, 'OK-user-debug') + @unittest.skip("Reverting the debug logs PR as host currently cannot handle" + "apps with lot of debug statements. Reverting PR: " + "azure-functions-python-worker/pull/745") def check_log_debug_with_user_logging(self, host_out: typing.List[str]): self.assertIn('logging info', host_out) self.assertIn('logging warning', host_out)