summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-14 16:33:28 +0200
committerGitHub <noreply@github.com>2020-07-14 16:33:28 +0200
commite387278b3bfb9c24a244a86f71483c4e40d521f1 (patch)
treea9cb049e1f32a301a44e7eefddd29f4b4a341bba
parent46dcd4ebea481a0cdc9028f7409de9e9f967f71d (diff)
parentb89dc6ae0051e04f710b66e94454720f321fb14e (diff)
Merge pull request #40315 from Calinou/project-manager-disable-file-logging
Disable file logging for the project manager
-rw-r--r--main/main.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/main/main.cpp b/main/main.cpp
index bb4751c61d..a500e173a2 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -954,21 +954,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
#endif
- GLOBAL_DEF("logging/file_logging/enable_file_logging", false);
- // Only file logging by default on desktop platforms as logs can't be
- // accessed easily on mobile/Web platforms (if at all).
- // This also prevents logs from being created for the editor instance, as feature tags
- // are disabled while in the editor (even if they should logically apply).
- GLOBAL_DEF("logging/file_logging/enable_file_logging.pc", true);
- GLOBAL_DEF("logging/file_logging/log_path", "user://logs/godot.log");
- GLOBAL_DEF("logging/file_logging/max_log_files", 5);
- ProjectSettings::get_singleton()->set_custom_property_info("logging/file_logging/max_log_files", PropertyInfo(Variant::INT, "logging/file_logging/max_log_files", PROPERTY_HINT_RANGE, "0,20,1,or_greater")); //no negative numbers
- if (FileAccess::get_create_func(FileAccess::ACCESS_USERDATA) && GLOBAL_GET("logging/file_logging/enable_file_logging")) {
- String base_path = GLOBAL_GET("logging/file_logging/log_path");
- int max_files = GLOBAL_GET("logging/file_logging/max_log_files");
- OS::get_singleton()->add_logger(memnew(RotatedFileLogger(base_path, max_files)));
- }
-
#ifdef TOOLS_ENABLED
if (editor) {
Engine::get_singleton()->set_editor_hint(true);
@@ -985,6 +970,23 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
#endif
+ GLOBAL_DEF("logging/file_logging/enable_file_logging", false);
+ // Only file logging by default on desktop platforms as logs can't be
+ // accessed easily on mobile/Web platforms (if at all).
+ // This also prevents logs from being created for the editor instance, as feature tags
+ // are disabled while in the editor (even if they should logically apply).
+ GLOBAL_DEF("logging/file_logging/enable_file_logging.pc", true);
+ GLOBAL_DEF("logging/file_logging/log_path", "user://logs/godot.log");
+ GLOBAL_DEF("logging/file_logging/max_log_files", 5);
+ ProjectSettings::get_singleton()->set_custom_property_info("logging/file_logging/max_log_files", PropertyInfo(Variant::INT, "logging/file_logging/max_log_files", PROPERTY_HINT_RANGE, "0,20,1,or_greater")); //no negative numbers
+ if (!project_manager && !editor && FileAccess::get_create_func(FileAccess::ACCESS_USERDATA) && GLOBAL_GET("logging/file_logging/enable_file_logging")) {
+ // Don't create logs for the project manager as they would be written to
+ // the current working directory, which is inconvenient.
+ String base_path = GLOBAL_GET("logging/file_logging/log_path");
+ int max_files = GLOBAL_GET("logging/file_logging/max_log_files");
+ OS::get_singleton()->add_logger(memnew(RotatedFileLogger(base_path, max_files)));
+ }
+
if (main_args.size() == 0 && String(GLOBAL_DEF("application/run/main_scene", "")) == "") {
#ifdef TOOLS_ENABLED
if (!editor && !project_manager) {