summaryrefslogtreecommitdiff
path: root/library/errorLogging.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/errorLogging.h')
-rw-r--r--library/errorLogging.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/library/errorLogging.h b/library/errorLogging.h
new file mode 100644
index 00000000..5fc5dacd
--- /dev/null
+++ b/library/errorLogging.h
@@ -0,0 +1,43 @@
+#ifndef ERRORLOGGING_H_INCLUDED
+#define ERRORLOGGING_H_INCLUDED
+
+#include <wx/string.h>
+#include <vector>
+
+class Zstring;
+
+namespace FreeFileSync
+{
+ class ErrorLogging
+ {
+ public:
+ ErrorLogging() : errorCount(0) {}
+
+ void logError(const wxString& errorMessage);
+ void logWarning(const wxString& warningMessage);
+ void logInfo(const wxString& infoMessage);
+
+ int errorsTotal()
+ {
+ return errorCount;
+ }
+
+ const std::vector<wxString>& getFormattedMessages()
+ {
+ return formattedMessages;
+ }
+
+ size_t messageCount()
+ {
+ return formattedMessages.size();
+ }
+
+ private:
+ wxString assembleMessage(const wxString& prefix, const wxString& message);
+
+ std::vector<wxString> formattedMessages; //list of non-resolved errors and warnings
+ int errorCount;
+ };
+}
+
+#endif // ERRORLOGGING_H_INCLUDED
bgstack15