summaryrefslogtreecommitdiff
path: root/include/mbgl/util/event.hpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-11-22 15:43:19 +0100
committerKonstantin Käfer <mail@kkaefer.com>2016-11-22 20:58:51 +0100
commite76de0540284118845c93c4351c82c6c8d5a090a (patch)
treedc295f87b74c5a4766444f6d1e7020e6219017a8 /include/mbgl/util/event.hpp
parent117863f1114551407c481abc752f5fcfd139c878 (diff)
downloadqtlocation-mapboxgl-e76de0540284118845c93c4351c82c6c8d5a090a.tar.gz
[build] move logging to util
Diffstat (limited to 'include/mbgl/util/event.hpp')
-rw-r--r--include/mbgl/util/event.hpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/include/mbgl/util/event.hpp b/include/mbgl/util/event.hpp
new file mode 100644
index 0000000000..7ad3d914e8
--- /dev/null
+++ b/include/mbgl/util/event.hpp
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <cstdint>
+
+namespace mbgl {
+
+enum class EventSeverity : uint8_t {
+ Debug,
+ Info,
+ Warning,
+ Error,
+};
+
+enum class Event : uint8_t {
+ General,
+ Setup,
+ Shader,
+ ParseStyle,
+ ParseTile,
+ Render,
+ Style,
+ Database,
+ HttpRequest,
+ Sprite,
+ Image,
+ OpenGL,
+ JNI,
+ Android,
+ Crash,
+ Glyph,
+};
+
+struct EventPermutation {
+ const EventSeverity severity;
+ const Event event;
+
+ constexpr bool operator==(const EventPermutation &rhs) const {
+ return severity == rhs.severity && event == rhs.event;
+ }
+};
+
+constexpr EventSeverity disabledEventSeverities[] = {
+#ifdef NDEBUG
+ EventSeverity(-1) // Avoid zero size array
+#else
+ EventSeverity::Debug
+#endif
+};
+
+constexpr Event disabledEvents[] = {
+ Event(-1) // Avoid zero size array
+};
+
+constexpr EventPermutation disabledEventPermutations[] = {
+ { EventSeverity::Debug, Event::Shader }
+};
+
+} // namespace mbgl