summaryrefslogtreecommitdiff
path: root/library/errorLogging.h
blob: 5fc5dacd75e86c6140f0f45d20dcfd7f47531436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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