]> granicus.if.org Git - icinga2/blob - lib/base/debuginfo.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / base / debuginfo.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef DEBUGINFO_H
4 #define DEBUGINFO_H
5
6 #include "base/i2-base.hpp"
7 #include "base/string.hpp"
8
9 namespace icinga
10 {
11
12 /**
13  * Debug information for a configuration element.
14  *
15  * @ingroup config
16  */
17 struct DebugInfo
18 {
19         String Path;
20
21         int FirstLine{0};
22         int FirstColumn{0};
23
24         int LastLine{0};
25         int LastColumn{0};
26 };
27
28 std::ostream& operator<<(std::ostream& out, const DebugInfo& val);
29
30 DebugInfo DebugInfoRange(const DebugInfo& start, const DebugInfo& end);
31
32 void ShowCodeLocation(std::ostream& out, const DebugInfo& di, bool verbose = true);
33
34 }
35
36 #endif /* DEBUGINFO_H */