fix(logger): use whole seconds rather than fractions for log filenames
This commit is contained in:
parent
3521f50d1b
commit
2f09c6eb9c
1 changed files with 2 additions and 1 deletions
|
@ -16,8 +16,9 @@ void Logger::init() {
|
|||
initProgramLogsDir();
|
||||
|
||||
const auto now = std::chrono::system_clock::now();
|
||||
const auto nows = std::chrono::floor<std::chrono::seconds>(now);
|
||||
|
||||
std::string fileName = std::format("log_{0:%Y%m%d}_{0:%H%M%S}.txt", now);
|
||||
std::string fileName = std::format("log_{0:%Y%m%d}_{0:%H%M%S}.txt", nows);
|
||||
|
||||
logStream = std::ofstream(currentLogDir = (getProgramLogsDir() + "/" + fileName));
|
||||
Logger::debug("Logger initialized");
|
||||
|
|
Loading…
Add table
Reference in a new issue