summaryrefslogtreecommitdiff
path: root/core/io/logger.cpp
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-06-13 12:14:39 +0200
committerGitHub <noreply@github.com>2018-06-13 12:14:39 +0200
commit62b75a94ec9c746aa6f58dad39ca2917428a38f1 (patch)
treecbf7bf24425b7c23684af1be3bbcf20813de62bd /core/io/logger.cpp
parentd2b75557a5dedf951ee036ca01af4f94bc059069 (diff)
parent1971baf8a9e1ca512cb48297b125c9004ef513cf (diff)
Merge pull request #19515 from YeldhamDev/log_creation_fix
Fixed regression making the logger not respect the max files limit
Diffstat (limited to 'core/io/logger.cpp')
-rw-r--r--core/io/logger.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index 8a5d683b56..786bec461b 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -112,7 +112,7 @@ void RotatedFileLogger::clear_old_backups() {
int max_backups = max_files - 1; // -1 for the current file
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());
if (!da) {
@@ -123,7 +123,7 @@ void RotatedFileLogger::clear_old_backups() {
String f = da->get_next();
Set<String> backups;
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);
}
f = da->get_next();