feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -30,14 +30,17 @@
|
|||
|
||||
#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"
|
||||
#include "core/string/print_string.h"
|
||||
#include "core/templates/rb_set.h"
|
||||
|
||||
#include "modules/modules_enabled.gen.h" // For regex.
|
||||
#ifdef MODULE_REGEX_ENABLED
|
||||
#include "modules/regex/regex.h"
|
||||
#else
|
||||
class RegEx : public RefCounted {};
|
||||
#endif // MODULE_REGEX_ENABLED
|
||||
|
||||
#if defined(MINGW_ENABLED) || defined(_MSC_VER)
|
||||
#define sprintf sprintf_s
|
||||
|
|
@ -84,11 +87,7 @@ void Logger::log_error(const char *p_function, const char *p_file, int p_line, c
|
|||
err_details = p_code;
|
||||
}
|
||||
|
||||
if (p_editor_notify) {
|
||||
logf_error("%s: %s\n", err_type, err_details);
|
||||
} else {
|
||||
logf_error("USER %s: %s\n", err_type, err_details);
|
||||
}
|
||||
logf_error("%s: %s\n", err_type, err_details);
|
||||
logf_error(" at: %s (%s:%i)\n", p_function, p_file, p_line);
|
||||
}
|
||||
|
||||
|
|
@ -131,7 +130,9 @@ void RotatedFileLogger::clear_old_backups() {
|
|||
|
||||
da->list_dir_begin();
|
||||
String f = da->get_next();
|
||||
HashSet<String> backups;
|
||||
// backups is a RBSet because it guarantees that iterating on it is done in sorted order.
|
||||
// RotatedFileLogger depends on this behavior to delete the oldest log file first.
|
||||
RBSet<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);
|
||||
|
|
@ -140,12 +141,12 @@ void RotatedFileLogger::clear_old_backups() {
|
|||
}
|
||||
da->list_dir_end();
|
||||
|
||||
if (backups.size() > (uint32_t)max_backups) {
|
||||
if (backups.size() > 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 (HashSet<String>::Iterator E = backups.begin(); E && to_delete > 0; ++E, --to_delete) {
|
||||
da->remove(*E);
|
||||
for (RBSet<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
|
||||
da->remove(E->get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue