Skip to content

Commit

Permalink
Windows does not support ':' in filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Nov 15, 2021
1 parent 315d13d commit 8867579
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::ofstream>(
(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<std::ofstream>(path);
if (!this->prod.file->is_open()) {
this->prod.file = nullptr;
return;
Expand Down

0 comments on commit 8867579

Please sign in to comment.