Skip to content

Commit

Permalink
Use native separator for paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Nov 15, 2021
1 parent db8276f commit 26a5fa9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/logging.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <iostream>
#include <QJsonObject>
#include <QDir>
#include "logging.h"
#include "lib/termcolor.h"

Expand Down Expand Up @@ -88,7 +89,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.toStdString() + "/" + filename);
this->prod.file = std::make_unique<std::ofstream>(
(this->prod.directory + QDir::separator()).toStdString() + filename
);
if (!this->prod.file->is_open()) {
this->prod.file = nullptr;
return;
Expand Down

0 comments on commit 26a5fa9

Please sign in to comment.