summaryrefslogtreecommitdiff
path: root/library/errorLogging.h
blob: 7b2b32c17defbad9e6388d43ea2f5d6b63666d74 (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