Commit fdb3cc38 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Minor fixes in akDebug

* make sure the destination directory exists
* write newline after each debug message
parent 278a85f8
......@@ -120,6 +120,7 @@ public:
#endif
const QByteArray buf = msg.toUtf8();
file.write(buf.constData(), buf.size());
file.write("\n");
file.flush();
if (origHandler) {
......@@ -134,6 +135,10 @@ public:
if (file.isOpen()) {
file.close();
}
QFileInfo finfo(errorLogFileName());
if (!finfo.absoluteDir().exists()) {
QDir().mkpath(finfo.absolutePath());
}
file.setFileName(errorLogFileName());
file.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment