* Create a timestamped filename. * @param ext The extension for the filename. * @param with_dir Whether to prepend the filename with the personal directory. * @return The filename */
| 74 | * @return The filename |
| 75 | */ |
| 76 | std::string CrashLog::CreateFileName(std::string_view ext, bool with_dir) const |
| 77 | { |
| 78 | static std::string crashname; |
| 79 | |
| 80 | if (crashname.empty()) { |
| 81 | crashname = fmt::format("crash{:%Y%m%d%H%M%S}", fmt::gmtime(time(nullptr))); |
| 82 | } |
| 83 | return fmt::format("{}{}{}", with_dir ? _personal_dir : std::string{}, crashname, ext); |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Fill the crash log buffer with all data of a crash log. |
no test coverage detected