From fd0853d2623dd278b08288331ed42e3be59252fb Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:00:17 +0200 Subject: 2.2 --- library/errorLogging.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 library/errorLogging.h (limited to 'library/errorLogging.h') 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 +#include + +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& getFormattedMessages() + { + return formattedMessages; + } + + size_t messageCount() + { + return formattedMessages.size(); + } + + private: + wxString assembleMessage(const wxString& prefix, const wxString& message); + + std::vector formattedMessages; //list of non-resolved errors and warnings + int errorCount; + }; +} + +#endif // ERRORLOGGING_H_INCLUDED -- cgit