]> vaikene.ee Git - evaf/blobdiff - src/libs/Common/ilogger.h
Changes and fixes to the iLogger interface:
[evaf] / src / libs / Common / ilogger.h
index 81d80160fbcfb707648f3fce57f953731d387e72..c89f9213b472b1a8763779697d0bde8d847fb97e 100644 (file)
@@ -3,7 +3,7 @@
  * @brief Logger interface for eVaf
  * @author Enar Vaikene
  *
- * Copyright (c) 2011 Enar Vaikene
+ * Copyright (c) 2011-2012 Enar Vaikene
  *
  * This file is part of the eVaf C++ cross-platform application development framework.
  *
@@ -62,7 +62,8 @@ public:
         Error,      ///< Unexpected issues in the software that could be solved automatically.
         Warning,    ///< Expected issues in the software that will be solved automatically.
         Info,       ///< General information output by the application or modules.
-        Debug       ///< Information for debugging purposes.
+        Debug,      ///< Information for debugging purposes.
+        Count       ///< Number of severity levels
     };
 
     /// Interface constructor
@@ -92,6 +93,8 @@ public:
      *
      * Use the setDefaultSource() function to change the default source name. If not set, then
      * uses the default source name "common".
+     *
+     * Changing the name of the default source resets any other settings set for the default source.
      */
     virtual void setDefaultSource(QString const & source) = 0;
 
@@ -99,7 +102,7 @@ public:
      * Returns the current severity level
      * @param source Name of the source or default if omitted.
      */
-    virtual Severity severity(QString const & source = 0) const = 0;
+    virtual Severity severity(QString const & source = 0) = 0;
 
     /**
      * Changes the current severity level.
@@ -116,7 +119,7 @@ public:
      * Returns the current maximum size of log files in KiB.
      * @param source Name of the source or default if omitted.
      */
-    virtual uint maxSize(QString const & source = 0) const = 0;
+    virtual uint maxSize(QString const & source = 0) = 0;
 
     /**
      * Changes the maximum size of log files for the given source
@@ -136,7 +139,7 @@ public:
      * Returns the maximum number of log files.
      * @param source Name of the source or default if omitted.
      */
-    virtual uint maxCount(QString const & source = 0) const = 0;
+    virtual uint maxCount(QString const & source = 0) = 0;
 
     /**
      * Changes the maximum number of log files
@@ -226,6 +229,22 @@ public:
      */
     virtual FatalMsgHandler installFatalMsgHandler(FatalMsgHandler newHandler) = 0;
 
+
+signals:
+
+    /**
+     * Logger event signal
+     * @param severity Severity of the message
+     * @param text The message
+     * @param source Source of the message
+     * @param where Where the message was output
+     *
+     * This signal is emitted for every message output with the iLogger interface. Connect
+     * your receiver to this signal if you want to add your own message handling. For example,
+     * use this signal to show messages in a log window etc.
+     */
+    void loggerEvent(Common::iLogger::Severity severity, QString const & text, QString const & source, QString const & where);
+
 };
 
 } // namespace eVaf::Common