diff --git a/CellFrameDashboardService/CellFrameDashboardService.pro b/CellFrameDashboardService/CellFrameDashboardService.pro index 3e2af3a756e8ab57b49dc783f3e8ff78f716db07..8a9b10ba35fde48fcd060ccd90afefaccf59f53c 100755 --- a/CellFrameDashboardService/CellFrameDashboardService.pro +++ b/CellFrameDashboardService/CellFrameDashboardService.pro @@ -22,11 +22,13 @@ win32 { VERSION = $${VER_MAJ}.$${VER_MIN}.$$VER_PAT DEFINES += CLI_PATH=\\\"./kelvin-node-cli.exe\\\" DEFINES += LOG_FILE=\\\"./opt/cellframe-node/var/log/cellframe-node_logs.txt\\\" + DEFINES += CMD_LOG=\\\"./opt/cellframe-dashboard/data/cellframe-cmd_log.txt\\\" } else { VERSION = $$VER_MAJ\.$$VER_MIN\-$$VER_PAT DEFINES += CLI_PATH=\\\"/opt/cellframe-node/bin/cellframe-node-cli\\\" DEFINES += LOG_FILE=\\\"/opt/cellframe-node/var/log/cellframe-node_logs.txt\\\" + DEFINES += CMD_LOG=\\\"/opt/cellframe-dashboard/data/cellframe-cmd_log.txt\\\" } # The following define makes your compiler emit warnings if you use diff --git a/CellFrameDashboardService/DapChainConsoleHandler.cpp b/CellFrameDashboardService/DapChainConsoleHandler.cpp index c13b20ac7eda6d00de44bdeec7eb5c192845734c..c65b2aa344b19fcab50f070a6f912d79ba3228e2 100644 --- a/CellFrameDashboardService/DapChainConsoleHandler.cpp +++ b/CellFrameDashboardService/DapChainConsoleHandler.cpp @@ -4,7 +4,8 @@ DapChainConsoleHandler::DapChainConsoleHandler(QObject *parent) : QObject(parent) { - m_File = new QFile("cmd_log.txt", this); + QDir().mkpath(QFileInfo(CMD_LOG).path()); + m_File = new QFile(CMD_LOG, this); m_File->open(QIODevice::Append | QIODevice::ReadWrite); } diff --git a/CellFrameDashboardService/DapChainConsoleHandler.h b/CellFrameDashboardService/DapChainConsoleHandler.h index 907c47e6b9a62b15c312a0abdef0900c76f32df3..faaced1aad3a66ad9277a9555b6b44b2efd783f7 100644 --- a/CellFrameDashboardService/DapChainConsoleHandler.h +++ b/CellFrameDashboardService/DapChainConsoleHandler.h @@ -5,6 +5,7 @@ #include <QProcess> #include <QDebug> #include <QFile> +#include <QDir> class DapChainConsoleHandler : public QObject {