diff options
| author | xiphon <xiphon@protonmail.com> | 2020-10-08 15:52:34 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-10-08 18:28:07 +0000 |
| commit | 3c28ecef93949224f68d301f71d47296cc67e2f5 (patch) | |
| tree | f23df1eae23ebbadcc9e8f138108e039366f14db /src/main/Logger.h | |
| parent | d3943ca2a9e1fa27ec9141ed94e1d4fb530aca31 (diff) | |
| download | monzero-gui-3c28ecef93949224f68d301f71d47296cc67e2f5.tar.gz monzero-gui-3c28ecef93949224f68d301f71d47296cc67e2f5.tar.xz monzero-gui-3c28ecef93949224f68d301f71d47296cc67e2f5.zip | |
Logger: runtime log config, no logs till a user selects wallet mode
Diffstat (limited to 'src/main/Logger.h')
| -rw-r--r-- | src/main/Logger.h | 27 |
1 files changed, 22 insertions, 5 deletions
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 <QCoreApplication> +#include <QObject> +#include <QString> -#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; +}; |
