Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak log file names for consistency between Mono and non-Mono logs #44148

Merged
merged 1 commit into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/io/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
6 changes: 3 additions & 3 deletions modules/mono/mono_gd/gd_mono_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down