diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-08 09:42:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 09:42:54 +0100 |
commit | a834055c63811aecf9a3a08d245ca2454a1ede8e (patch) | |
tree | 7bb098134351f3517d338dff2141ad5ae37eb9c6 | |
parent | c0e6962aa0bc8871c331248a931133e54e3ff509 (diff) | |
parent | 4d81776fc9364950bbe89d7da61fe3a7c965334f (diff) |
Merge pull request #44148 from Calinou/tweak-log-file-names
Tweak log file names for consistency between Mono and non-Mono logs
-rw-r--r-- | core/io/logger.cpp | 2 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_log.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp index 0e6a2e2c9f..f5cea00f28 100644 --- a/core/io/logger.cpp +++ b/core/io/logger.cpp @@ -152,7 +152,7 @@ void RotatedFileLogger::rotate_file() { char timestamp[21]; OS::Date date = OS::get_singleton()->get_date(); OS::Time time = OS::get_singleton()->get_time(); - sprintf(timestamp, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec); + sprintf(timestamp, "_%04d-%02d-%02d_%02d.%02d.%02d", date.year, date.month, date.day, time.hour, time.min, time.sec); String backup_name = base_path.get_basename() + timestamp; if (base_path.get_extension() != String()) { diff --git a/modules/mono/mono_gd/gd_mono_log.cpp b/modules/mono/mono_gd/gd_mono_log.cpp index b8ee0204c4..7584e7ff0d 100644 --- a/modules/mono/mono_gd/gd_mono_log.cpp +++ b/modules/mono/mono_gd/gd_mono_log.cpp @@ -160,13 +160,13 @@ void GDMonoLog::initialize() { OS::Date date_now = OS::get_singleton()->get_date(); OS::Time time_now = OS::get_singleton()->get_time(); - String log_file_name = str_format("%d_%02d_%02d %02d.%02d.%02d", + String log_file_name = str_format("%04d-%02d-%02d_%02d.%02d.%02d", date_now.year, date_now.month, date_now.day, time_now.hour, time_now.min, time_now.sec); - log_file_name += str_format(" (%d)", OS::get_singleton()->get_process_id()); + log_file_name += str_format("_%d", OS::get_singleton()->get_process_id()); - log_file_name += ".txt"; + log_file_name += ".log"; log_file_path = logs_dir.plus_file(log_file_name); |