summaryrefslogtreecommitdiff
path: root/core/io/logger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/logger.cpp')
-rw-r--r--core/io/logger.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp
index c19fc2820b..b0f74f8db5 100644
--- a/core/io/logger.cpp
+++ b/core/io/logger.cpp
@@ -31,6 +31,7 @@
#include "logger.h"
#include "core/config/project_settings.h"
+#include "core/core_globals.h"
#include "core/io/dir_access.h"
#include "core/os/os.h"
#include "core/os/time.h"
@@ -41,7 +42,7 @@
#endif
bool Logger::should_log(bool p_err) {
- return (!p_err || _print_error_enabled) && (p_err || _print_line_enabled);
+ return (!p_err || CoreGlobals::print_error_enabled) && (p_err || CoreGlobals::print_line_enabled);
}
bool Logger::_flush_stdout_on_print = true;
@@ -128,7 +129,7 @@ void RotatedFileLogger::clear_old_backups() {
da->list_dir_begin();
String f = da->get_next();
- Set<String> backups;
+ HashSet<String> backups;
while (!f.is_empty()) {
if (!da->current_is_dir() && f.begins_with(basename) && f.get_extension() == extension && f != base_path.get_file()) {
backups.insert(f);
@@ -137,12 +138,12 @@ void RotatedFileLogger::clear_old_backups() {
}
da->list_dir_end();
- if (backups.size() > max_backups) {
+ if (backups.size() > (uint32_t)max_backups) {
// since backups are appended with timestamp and Set iterates them in sorted order,
// first backups are the oldest
int to_delete = backups.size() - max_backups;
- for (Set<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
- da->remove(E->get());
+ for (HashSet<String>::Iterator E = backups.begin(); E && to_delete > 0; ++E, --to_delete) {
+ da->remove(*E);
}
}
}
@@ -172,7 +173,7 @@ void RotatedFileLogger::rotate_file() {
}
file = FileAccess::open(base_path, FileAccess::WRITE);
- file->detach_from_objectdb(); // Note: This FileAccess instance will exist longer than ObjectDB, therefor can't be registered in ObjectDB.
+ file->detach_from_objectdb(); // Note: This FileAccess instance will exist longer than ObjectDB, therefore can't be registered in ObjectDB.
}
RotatedFileLogger::RotatedFileLogger(const String &p_base_path, int p_max_files) :