Skip to content

Commit d76ff60

Browse files
authored
Reverting #745 to limit Debug logs (#780)
* Reverting #745 to limit Debug logs
1 parent 05b0360 commit d76ff60

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

azure_functions_worker/dispatcher.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ async def dispatch_forever(self):
130130
# established, should use it for system and user logs
131131
logging_handler = AsyncLoggingHandler()
132132
root_logger = logging.getLogger()
133-
root_logger.setLevel(logging.DEBUG)
133+
134+
# Don't change this unless you read #780 and #745
135+
root_logger.setLevel(logging.INFO)
134136
root_logger.addHandler(logging_handler)
135137
logger.info('Switched to gRPC logging.')
136138
logging_handler.flush()

azure_functions_worker/testutils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ def wrapper(self, *args, __meth__=test_case,
148148
# Trim off host output timestamps
149149
host_output = getattr(self, 'host_out', '')
150150
output_lines = host_output.splitlines()
151-
ts_re = r"^\[\d+\/\d+\/\d+ \d+\:\d+\:\d+.*(A|P)*M*\]"
152-
output = list(map(
153-
lambda s: re.sub(ts_re, '', s).strip(),
154-
output_lines))
151+
ts_re = r"^\[\d+(\/|-)\d+(\/|-)\d+T*\d+\:\d+\:\d+.*(" \
152+
r"A|P)*M*\]"
153+
output = list(map(lambda s:
154+
re.sub(ts_re, '', s).strip(),
155+
output_lines))
155156

156157
# Execute check_log_ test cases
157158
self._run_test(__check_log__, host_out=output)

tests/unittests/test_http_functions.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import filecmp
66
import typing
77
import os
8+
import unittest
89

910
import pytest
1011

@@ -98,22 +99,34 @@ def check_log_async_logging(self, host_out: typing.List[str]):
9899
self.assertIn('hello info', host_out)
99100
self.assertIn('and another error', host_out)
100101

102+
@unittest.skip("Reverting the debug logs PR as host currently cannot handle"
103+
"apps with lot of debug statements. Reverting PR: "
104+
"azure-functions-python-worker/pull/745")
101105
def test_debug_logging(self):
102106
r = self.webhost.request('GET', 'debug_logging')
103107
self.assertEqual(r.status_code, 200)
104108
self.assertEqual(r.text, 'OK-debug')
105109

110+
@unittest.skip("Reverting the debug logs PR as host currently cannot handle"
111+
"apps with lot of debug statements. Reverting PR: "
112+
"azure-functions-python-worker/pull/745")
106113
def check_log_debug_logging(self, host_out: typing.List[str]):
107114
self.assertIn('logging info', host_out)
108115
self.assertIn('logging warning', host_out)
109116
self.assertIn('logging debug', host_out)
110117
self.assertIn('logging error', host_out)
111118

119+
@unittest.skip("Reverting the debug logs PR as host currently cannot handle"
120+
"apps with lot of debug statements. Reverting PR: "
121+
"azure-functions-python-worker/pull/745")
112122
def test_debug_with_user_logging(self):
113123
r = self.webhost.request('GET', 'debug_user_logging')
114124
self.assertEqual(r.status_code, 200)
115125
self.assertEqual(r.text, 'OK-user-debug')
116126

127+
@unittest.skip("Reverting the debug logs PR as host currently cannot handle"
128+
"apps with lot of debug statements. Reverting PR: "
129+
"azure-functions-python-worker/pull/745")
117130
def check_log_debug_with_user_logging(self, host_out: typing.List[str]):
118131
self.assertIn('logging info', host_out)
119132
self.assertIn('logging warning', host_out)

0 commit comments

Comments
 (0)