diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-07-04 16:59:49 +0200 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2020-07-08 18:57:25 +0200 |
commit | 20af28ec0651da256e2c9ccefc868ea028c73a4a (patch) | |
tree | a4cc72c6aaabf5e52e45f1613c32944b0bbf1f39 /core/io | |
parent | 597b268150b208f3d3edf4410b5f6741e1d153f4 (diff) |
Enable file logging by default on desktops to help with troubleshooting
- Use the `.log` file extension (recognized on Windows out of the box)
to better hint that generated files are logs. Some editors provide
dedicated syntax highlighting for those files.
- Use an underscore to separate the basename from the date and
the date from the time in log filenames. This makes the filename
easier to read.
- Keep only 5 log files by default to decrease disk usage in case
messages are spammed.
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/logger.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/io/logger.cpp b/core/io/logger.cpp index ef78b1194e..886e5695b1 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()) { |