]> granicus.if.org Git - icinga2/blob - lib/base/stacktrace.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / stacktrace.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef STACKTRACE_H
4 #define STACKTRACE_H
5
6 #include "base/i2-base.hpp"
7 #include <iosfwd>
8
9 namespace icinga
10 {
11
12 /**
13  * A stacktrace.
14  *
15  * @ingroup base
16  */
17 class StackTrace
18 {
19 public:
20         StackTrace();
21 #ifdef _WIN32
22         explicit StackTrace(PEXCEPTION_POINTERS exi);
23 #endif /* _WIN32 */
24
25         void Print(std::ostream& fp, int ignoreFrames = 0) const;
26
27         static void StaticInitialize();
28
29 private:
30         void *m_Frames[64];
31         int m_Count;
32 };
33
34 std::ostream& operator<<(std::ostream& stream, const StackTrace& trace);
35
36 }
37
38 #endif /* UTILITY_H */