Files
MapLibreParticleLab/include/mbgl/util/event.hpp
Lloyd Sheng eb70b89849 [core] Measuring tiles requesting/parsing time using logging (#12152)
* Tile timing

* Refactor logging code

* Keep the scope of `messageStream` constrained

* Make log message more clear

* Fix crash issue if onlineResponse.data is null
2018-06-21 11:24:14 +08:00

60 lines
971 B
C++

#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,
Timing
};
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[] = {
#ifndef 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