From 8867579cdcff95227e516b06183829e0fdabf3e0 Mon Sep 17 00:00:00 2001 From: Jan Horacek Date: Mon, 15 Nov 2021 20:42:36 +0100 Subject: [PATCH] Windows does not support ':' in filename. --- src/logging.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/logging.cpp b/src/logging.cpp index eb2850d..5fdf1a1 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -88,10 +88,9 @@ void Logger::prodLog(const QString& message, Mtb::LogLevel loglevel) { } void Logger::prodInit() { - std::string filename = QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss").toStdString() + ".log"; - this->prod.file = std::make_unique( - (this->prod.directory + QDir::separator()).toStdString() + filename - ); + const std::string filename = QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss").toStdString() + ".log"; + const std::string path = (this->prod.directory + QDir::separator()).toStdString() + filename; + this->prod.file = std::make_unique(path); if (!this->prod.file->is_open()) { this->prod.file = nullptr; return;