diff --git a/core/core.pro b/core/core.pro
index 6b05671..42312f1 100644
--- a/core/core.pro
+++ b/core/core.pro
@@ -48,8 +48,7 @@ SOURCES += \
src/http_advertiser.cpp \
src/logger/u_logger.cpp \
src/logger/writer_modcall.cpp \
- src/logger/writer_full.cpp \
- src/logger/writer_sql.cpp
+ src/logger/writer_full.cpp
HEADERS += include/advertiser.h \
include/aoclient.h \
@@ -65,5 +64,4 @@ HEADERS += include/advertiser.h \
include/http_advertiser.h \
include/logger/u_logger.h \
include/logger/writer_modcall.h \
- include/logger/writer_full.h \
- include/logger/writer_sql.h
+ include/logger/writer_full.h
diff --git a/core/include/data_types.h b/core/include/data_types.h
index 0a6e397..4983f86 100644
--- a/core/include/data_types.h
+++ b/core/include/data_types.h
@@ -42,7 +42,6 @@ public:
enum class LogType {
MODCALL,
FULL,
- SQL
};
Q_ENUM(LogType)
};
diff --git a/core/include/logger/u_logger.h b/core/include/logger/u_logger.h
index 9a70398..c0688d5 100644
--- a/core/include/logger/u_logger.h
+++ b/core/include/logger/u_logger.h
@@ -25,7 +25,6 @@
#include "include/config_manager.h"
#include "include/logger/writer_full.h"
#include "include/logger/writer_modcall.h"
-#include "include/logger/writer_sql.h"
/**
* @brief The Universal Logger class to provide a common place to handle, store and write logs to file.
@@ -122,11 +121,6 @@ private:
* @brief Pointer to full writer. Handles single messages in one file.
*/
WriterFull* writerFull;
-
- /**
- * @brief Pointer to SQL writer. Handles execution of log SQL queries.
- */
- WriterSQL* writerSQL;
};
#endif //U_LOGGER_H
diff --git a/core/include/logger/writer_sql.h b/core/include/logger/writer_sql.h
deleted file mode 100644
index 53b8eb2..0000000
--- a/core/include/logger/writer_sql.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////////////
-// akashi - a server for Attorney Online 2 //
-// Copyright (C) 2020 scatterflower //
-// //
-// This program is free software: you can redistribute it and/or modify //
-// it under the terms of the GNU Affero General Public License as //
-// published by the Free Software Foundation, either version 3 of the //
-// License, or (at your option) any later version. //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU Affero General Public License for more details. //
-// //
-// You should have received a copy of the GNU Affero General Public License //
-// along with this program. If not, see . //
-//////////////////////////////////////////////////////////////////////////////////////
-#ifndef WRITER_SQL_H
-#define WRITER_SQL_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/**
- * @brief A class to handle database interaction when executing SQL statements in SQL mode.
- */
-class WriterSQL : public QObject
-{
- Q_OBJECT
-public:
- /**
- * @brief Constructor for SQL logwriter
- *
- * @param QObject pointer to the parent object.
- */
- WriterSQL(QObject* parent = nullptr);
-
- /**
- * @brief Deconstructor for SQL logwriter. Closes the underlying database
- */
- virtual ~WriterSQL();;
-
- /**
- * @brief Function to execute SQL queries on the log database.
- * @param SQL query execute d on the log database.
- */
- void execLogScript(QSqlQuery query);
-
-private:
-
- /**
- * @brief The name of the database connection driver.
- */
- const QString DRIVER;
-
- /**
- * @brief The backing database that stores user details.
- */
- QSqlDatabase log_db;
-
- /**
- * @brief Directory where logfiles will be stored.
- */
- QDir l_dir;
-};
-
-#endif //WRITER_SQL_H
diff --git a/core/src/logger/u_logger.cpp b/core/src/logger/u_logger.cpp
index ee1cdbe..5e2bcea 100644
--- a/core/src/logger/u_logger.cpp
+++ b/core/src/logger/u_logger.cpp
@@ -27,9 +27,6 @@ ULogger::ULogger(QObject* parent) :
case DataTypes::LogType::FULL :
writerFull = new WriterFull;
break;
- case DataTypes::LogType::SQL :
- writerSQL = new WriterSQL;
- break;
}
}
@@ -42,9 +39,6 @@ ULogger::~ULogger()
case DataTypes::LogType::FULL :
writerFull->deleteLater();
break;
- case DataTypes::LogType::SQL :
- writerSQL->deleteLater();
- break;
}
}
diff --git a/core/src/logger/writer_sql.cpp b/core/src/logger/writer_sql.cpp
deleted file mode 100644
index 311bfc8..0000000
--- a/core/src/logger/writer_sql.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////////////
-// akashi - a server for Attorney Online 2 //
-// Copyright (C) 2020 scatterflower //
-// //
-// This program is free software: you can redistribute it and/or modify //
-// it under the terms of the GNU Affero General Public License as //
-// published by the Free Software Foundation, either version 3 of the //
-// License, or (at your option) any later version. //
-// //
-// This program is distributed in the hope that it will be useful, //
-// but WITHOUT ANY WARRANTY; without even the implied warranty of //
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
-// GNU Affero General Public License for more details. //
-// //
-// You should have received a copy of the GNU Affero General Public License //
-// along with this program. If not, see . //
-//////////////////////////////////////////////////////////////////////////////////////
-#include "include/logger/writer_sql.h"
-
-WriterSQL::WriterSQL(QObject* parent) :
- QObject(parent), DRIVER("QSQLITE")
-{
- l_dir.setPath("logs/");
- if (!l_dir.exists()) {
- l_dir.mkpath(".");
- }
-
- l_dir.setPath("logs/database");
- if (!l_dir.exists()) {
- l_dir.mkpath(".");
- }
-
- const QString db_filename = "logs/database/log.db";
-
- QFileInfo db_info(db_filename);
- if(!db_info.isReadable() || !db_info.isWritable())
- qCritical() << tr("Database Error: Missing permissions. Check if \"%1\" is writable.").arg(db_filename);
-
- log_db = QSqlDatabase::addDatabase(DRIVER);
- log_db.setDatabaseName("logs/database/log.db");
-
- if (!log_db.open())
- qCritical() << "Database Error:" << log_db.lastError();
-
- QSqlQuery create_chat_events_table("CREATE TABLE IF NOT EXISTS chat_events ('event_time' DATETIME DEFAULT CURRENT_TIMESTAMP, 'ipid' TEXT, 'room_name' TEXT,'event_type' TEXT, 'char_name' TEXT, 'ic_name' TEXT, 'message' TEXT NOT NULL);");
- create_chat_events_table.exec();
-
- QSqlQuery create_connection_events_table("CREATE TABLE IF NOT EXISTS connection_events ('event time' DATETIME DEFAULT CURRENT_TIMESTAMP, 'ipid' TEXT, 'ip_address' TEXT, 'hdid' TEXT);");
- create_connection_events_table.exec();
-}
-
-WriterSQL::~WriterSQL()
-{
- log_db.close();
-}
-
-void WriterSQL::execLogScript(QSqlQuery query)
-{
- query.exec();
- QSqlError error = query.lastError();
- if (error.isValid()) {
- qDebug() << "Database Error:" + error.text();
- }
-}