Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ def _setup_log_levels(debug: bool):

if __name__ == '__main__':
k8s_env = is_k8s_env()
app_config: TConfig = app.extra['CONFIG']
logging_config = get_logging_config(LOGGER_K8S_CONFIG_NAME if k8s_env else LOGGER_CONFIG_NAME)
if app_config.debug:
# the file handler is already at DEBUG; without this the detail never reaches
# stderr, which is where a container deployment is read from
stderr_handler = logging_config.get('handlers', {}).get('stderr')
if stderr_handler is not None:
stderr_handler['level'] = 'DEBUG'
setup_logging(logging_config)
app_config: TConfig = app.extra['CONFIG']
_setup_log_levels(app_config.debug)

# do forks from a clean process that doesn't have any threads or locks
Expand Down