~kgunn72/mir/dont-crash-when-shooting-invalid-surface

« back to all changes in this revision

Viewing changes to include/shared/mir/logging/logger.h

  • Committer: Tarmac
  • Author(s): Alan Griffiths, Alexandros Frantzis, Daniel van Vugt, Kevin DuBois, Christopher James Halse Rogers, chris.gagnon, Mathieu Trudel-Lapierre, Robert Carr, Automatic PS uploader, Kevin Gunn, Daniel d'Andrada, Christopher James Halse Rogers, Michael Terry, Brandon Schaefer, Timo Jyrinki, Mir Team, Andreas Pokorny
  • Date: 2013-12-20 11:11:22 UTC
  • mfrom: (1169.1.1 version-0.1.3)
  • Revision ID: tarmac-20131220111122-h503fd1fnq7pn9za
Latest upstream release: Mir 0.1.3 (r1298).

Approved by Alan Griffiths, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        debug = 4
40
40
    };
41
41
 
42
 
    template<Severity severity>
43
 
    void log(const std::string& message)
44
 
    {
45
 
        static const std::string unknown_component("UnknownComponent");
46
 
        log(severity, message, unknown_component);
47
 
    }
48
42
 
49
 
    template<Severity severity>
50
 
    void log(const std::string& message, const std::string& component)
51
 
    {
52
 
        log(severity, message, component);
53
 
    }
 
43
    virtual void log(Severity severity,
 
44
                     const std::string& message,
 
45
                     const std::string& component = "UnknownComponent") = 0;
54
46
 
55
47
protected:
56
48
    Logger() {}
57
49
    virtual ~Logger() = default;
58
50
    Logger(const Logger&) = delete;
59
51
    Logger& operator=(const Logger&) = delete;
60
 
 
61
 
    virtual void log(Severity severity,
62
 
                     const std::string& message,
63
 
                     const std::string& component) = 0;
64
52
};
65
53
}
66
54
}