-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorEvent.cpp
49 lines (42 loc) · 941 Bytes
/
ErrorEvent.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "stdafx.h"
#include "ErrorEvent.h"
#include "ErrorEvent.pb.h"
namespace GameAnalytics
{
ErrorEvent::ErrorEvent() {}
ErrorEvent::~ErrorEvent() {}
std::string ErrorEvent::getCategory()
{
return "error";
}
void ErrorEvent::setMessage(std::string msg)
{
mData.SetExtension(ProtocolBuffers::GameAnalytics::ErrorEvent::message, msg);
}
void ErrorEvent::setSeverity(ErrorSeverity es)
{
std::string sev;
switch (es)
{
case GameAnalytics::ErrorSeverity::Info:
sev = "info";
break;
case GameAnalytics::ErrorSeverity::Debug:
sev = "debug";
break;
case GameAnalytics::ErrorSeverity::Warning:
sev = "warning";
break;
case GameAnalytics::ErrorSeverity::Error:
sev = "error";
break;
case GameAnalytics::ErrorSeverity::Critical:
sev = "critical";
break;
default:
sev = "info";
break;
}
mData.SetExtension(ProtocolBuffers::GameAnalytics::ErrorEvent::severity, sev);
}
}