Browse Source

Merge pull request #19515 from YeldhamDev/log_creation_fix

Fixed regression making the logger not respect the max files limit
Max Hilbrunner 7 years ago
parent
commit
62b75a94ec
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/io/logger.cpp

+ 2 - 2
core/io/logger.cpp

@@ -112,7 +112,7 @@ void RotatedFileLogger::clear_old_backups() {
 	int max_backups = max_files - 1; // -1 for the current file
 	int max_backups = max_files - 1; // -1 for the current file
 
 
 	String basename = base_path.get_file().get_basename();
 	String basename = base_path.get_file().get_basename();
-	String extension = "." + base_path.get_extension();
+	String extension = base_path.get_extension();
 
 
 	DirAccess *da = DirAccess::open(base_path.get_base_dir());
 	DirAccess *da = DirAccess::open(base_path.get_base_dir());
 	if (!da) {
 	if (!da) {
@@ -123,7 +123,7 @@ void RotatedFileLogger::clear_old_backups() {
 	String f = da->get_next();
 	String f = da->get_next();
 	Set<String> backups;
 	Set<String> backups;
 	while (f != String()) {
 	while (f != String()) {
-		if (!da->current_is_dir() && f.begins_with(basename) && f.ends_with(extension) && f != base_path.get_file()) {
+		if (!da->current_is_dir() && f.begins_with(basename) && f.get_extension() == extension && f != base_path.get_file()) {
 			backups.insert(f);
 			backups.insert(f);
 		}
 		}
 		f = da->get_next();
 		f = da->get_next();