X-Git-Url: https://vaikene.ee/gitweb/pswgen10.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Flogger.h;h=742ab9036a7957d48ea42cbd9170306f4418f4bd;hb=de270ece1b764b19968e14420f538321f1c06b15;hp=6e49ef723bcbd621fb65206045a1e671d4ff889c;hpb=cf45ef016ce162419f74f9165c4267a184714956;p=evaf
diff --git a/src/libs/Common/logger.h b/src/libs/Common/logger.h
index 6e49ef7..742ab90 100644
--- a/src/libs/Common/logger.h
+++ b/src/libs/Common/logger.h
@@ -3,7 +3,7 @@
* @brief iLogger interface implementation
* @author Enar Vaikene
*
- * Copyright (c) 2011-2012 Enar Vaikene
+ * Copyright (c) 2011-2019 Enar Vaikene
*
* This file is part of the eVaf C++ cross-platform application development framework.
*
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
class QThread;
@@ -36,7 +37,7 @@ namespace Common {
namespace Internal {
/// Default fatal error message handler
-void defFatalMsgHandler(QString const & msg, QString const & source, QString const & where);
+[[noreturn]] void defFatalMsgHandler(QString const & msg, QString const & source, QString const & where);
/**
* Logger source.
@@ -138,6 +139,11 @@ class Logger : public iLogger
public:
+ /**
+ * Destroys the iLogger interface instance
+ */
+ static void destroyInstance();
+
Logger();
virtual ~Logger();
@@ -156,23 +162,23 @@ public:
virtual void setDefaultSource(QString const & source);
- virtual iLogger::Severity severity(QString const & source = 0);
+ virtual iLogger::Severity severity(QString const & source = QString());
- virtual void setSeverity(iLogger::Severity severity, QString const & source = 0);
+ virtual void setSeverity(iLogger::Severity severity, QString const & source = QString());
- virtual uint maxSize(QString const & source = 0);
+ virtual uint maxSize(QString const & source = QString());
- virtual void setMaxSize(uint maxSize, QString const & source = 0);
+ virtual void setMaxSize(uint maxSize, QString const & source = QString());
- virtual uint maxCount(QString const & source = 0);
+ virtual uint maxCount(QString const & source = QString());
- virtual void setMaxCount(uint maxCount, QString const & source = 0);
+ virtual void setMaxCount(uint maxCount, QString const & source = QString());
virtual iLogger::Severity consoleSeverity() const { return mConsoleSeverity; }
virtual void setConsoleSeverity(iLogger::Severity severity);
- virtual void write(Severity severity, QString const & msg, QString const & source = 0, QString const & where = 0);
+ virtual void write(Severity severity, QString const & msg, QString const & source = QString(), QString const & where = QString());
virtual QString printf(char const * const fmt, ...) const;
@@ -204,10 +210,10 @@ private: // Members
QHash > mSources;
/// Worker thread
- QThread * mThread;
+ QScopedPointer mThread;
/// Worker object
- LoggerWorker * mWorker;
+ QScopedPointer mWorker;
private: // Methods