Skip to content

Commit 6ddf154

Browse files
committed
Reverting #745 to limit Debug logs
1 parent 05b0360 commit 6ddf154

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

azure_functions_worker/dispatcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ 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+
root_logger.setLevel(logging.INFO)
134134
root_logger.addHandler(logging_handler)
135135
logger.info('Switched to gRPC logging.')
136136
logging_handler.flush()

azure_functions_worker/testutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ 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*\]"
151+
ts_re = r"^\[\d+(\/|-)\d+(\/|-)\d+T*\d+\:\d+\:\d+.*(A|P)*M*\]"
152152
output = list(map(
153153
lambda s: re.sub(ts_re, '', s).strip(),
154154
output_lines))

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)