diff --git a/addons/mod_loader/mod_loader.gd b/addons/mod_loader/mod_loader.gd index da7fed44..36e6f850 100644 --- a/addons/mod_loader/mod_loader.gd +++ b/addons/mod_loader/mod_loader.gd @@ -87,6 +87,9 @@ var loaded_vanilla_parents_cache := {} # Helps to decide whether a script extension should go through the _handle_script_extensions process var is_initializing := true +# Keeps track of logged messages, to avoid flooding the log with duplicate notices +var logged_messages := [] + # These variables handle various options, which can be changed via Godot's GUI # by adding a ModLoaderOptions resource to the resource file specified by # `ml_options_path`. See res://addons/mod_loader/options_examples for some @@ -775,7 +778,11 @@ func get_mod_config(mod_dir_name: String = "", key: String = "") -> Dictionary: if not status_code == MLConfigStatus.OK: if status_code == MLConfigStatus.NO_JSON_OK: # No user config file exists. Low importance as very likely to trigger - ModLoaderUtils.log_debug("Config JSON Notice: %s" % status_msg, mod_dir_name) + var full_msg = "Config JSON Notice: %s" % status_msg + # Only log this once, to avoid flooding the log + if not logged_messages.has(full_msg): + ModLoaderUtils.log_debug(full_msg, mod_dir_name) + logged_messages.push_back(full_msg) else: # Code error (eg. invalid mod ID) ModLoaderUtils.log_fatal("Config JSON Error (%s): %s" % [status_code, status_msg], mod_dir_name)