From 3c28ecef93949224f68d301f71d47296cc67e2f5 Mon Sep 17 00:00:00 2001 From: xiphon Date: Thu, 8 Oct 2020 15:52:34 +0000 Subject: Logger: runtime log config, no logs till a user selects wallet mode --- src/main/Logger.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'src/main/Logger.h') diff --git a/src/main/Logger.h b/src/main/Logger.h index 7674a437..6d350ae8 100644 --- a/src/main/Logger.h +++ b/src/main/Logger.h @@ -26,11 +26,28 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef LOGGER_H -#define LOGGER_H +#pragma once -const QString getLogPath(const QString logPath); -void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message); +#include +#include +#include -#endif // LOGGER_H +class Logger : public QObject +{ + Q_OBJECT + Q_PROPERTY(QString logFilePath READ logFilePath NOTIFY logFilePathChanged) +public: + Logger(QCoreApplication &parent, QString userDefinedLogFilePath); + + Q_INVOKABLE void resetLogFilePath(bool portable); + QString logFilePath() const; + +signals: + void logFilePathChanged() const; + +private: + const std::string m_applicationFilePath; + QString m_logFilePath; + const QString m_userDefinedLogFilePath; +}; -- cgit v1.2.3