Skip to content

Commit 1eebabc

Browse files
gavin-aguiarGavin Aguiar
and
Gavin Aguiar
authored
Logging improvements (#1228)
* Logging improvements * Update logging info to warning --------- Co-authored-by: Gavin Aguiar <gavin@GavinPC>
1 parent 4a9a38e commit 1eebabc

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

azure_functions_worker/dispatcher.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ async def _handle__worker_init_request(self, request):
290290

291291
if DependencyManager.is_in_linux_consumption() \
292292
and is_envvar_true(PYTHON_LOAD_FUNCTIONS_INIT):
293+
logger.info(
294+
"PYTHON_LOAD_FUNCTIONS_INIT enabled. Importing azure functions")
293295
import azure.functions # NoQA
294296

295297
# loading bindings registry and saving results to a static

azure_functions_worker/utils/dependency.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,17 +210,17 @@ def reload_azure_google_namespace_from_worker_deps(cls):
210210
"""
211211
# Reload package namespaces for customer's libraries
212212
packages_to_reload = ['azure', 'google']
213+
packages_reloaded = []
213214
for p in packages_to_reload:
214215
try:
215-
logger.info('Reloading %s module', p)
216216
importlib.reload(sys.modules[p])
217+
packages_reloaded.append(p)
217218
except Exception as ex:
218-
logger.info('Unable to reload %s: \n%s', p, ex)
219-
logger.info('Reloaded %s module', p)
219+
logger.warning('Unable to reload %s: \n%s', p, ex)
220+
221+
logger.info(f'Reloaded modules: {",".join(packages_reloaded)}')
220222

221223
# Reload azure.functions to give user package precedence
222-
logger.info('Reloading azure.functions module at %s',
223-
inspect.getfile(sys.modules['azure.functions']))
224224
try:
225225
importlib.reload(sys.modules['azure.functions'])
226226
logger.info('Reloaded azure.functions module now at %s',

0 commit comments

Comments
 (0)