From e21a019de4a7c4cdfd66b371305650c6fa5a3eb8 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 27 Nov 2021 12:53:29 -0500 Subject: [PATCH] Add better logging to falling back to default language on server start. --- app/classes/shared/server.py | 2 +- app/classes/shared/tasks.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index eb00a34c..ba35ba7b 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -373,7 +373,7 @@ class Server: if self.settings['crash_detection']: logger.warning("The server {} has crashed and will be restarted. Restarting server".format(name)) console.warning("The server {} has crashed and will be restarted. Restarting server".format(name)) - self.run_threaded_server('en_EN') + self.run_threaded_server(helper.get_setting('language')) return True else: logger.critical( diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index 800335b9..f7d8e9ad 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -102,6 +102,9 @@ class TasksManager: command = c.get('command', None) if command == 'start_server': + if user_lang is None: + logger.warning('Could not capture user language from request. Falling back to default language from config file.') + user_lang = helper.get_setting('language') svr.run_threaded_server(user_lang) elif command == 'stop_server':