-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLogObject.cs
More file actions
94 lines (85 loc) · 2.28 KB
/
LogObject.cs
File metadata and controls
94 lines (85 loc) · 2.28 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using com.mapcolonies.core.Services.Analytics.Enums;
using UnityEngine;
namespace com.mapcolonies.core.Services.Analytics.Model
{
[Serializable]
public class LogObject
{
public string SessionID
{
get;
internal set;
}
public string Severity
{
get;
private set;
} //TODO: Change to Log4Net enum
public DateTime TimeStamp
{
get;
private set;
}
public string Message
{
get;
private set;
}
public IAnalyticLogParameter MessageParameters
{
get;
private set;
}
public string Component
{
get;
private set;
}
public AnalyticsMessageTypes MessageType
{
get;
private set;
}
private LogObject(
string severity,
DateTime timeStamp,
string message,
IAnalyticLogParameter messageParameters,
string component,
AnalyticsMessageTypes messageType)
{
Severity = severity;
TimeStamp = timeStamp;
Message = message;
MessageParameters = messageParameters;
Component = component;
MessageType = messageType;
}
/// <summary>
/// Create a LogObject type
/// </summary>
/// <param name="severity">Log severity</param>
/// <param name="message">Description</param>
/// <param name="messageParameters">Log content</param>
/// <param name="component">Log component</param>
/// <param name="messageType">Analytics message type</param>
/// <returns>LogObject</returns>
public static LogObject Create(
LogType severity,
string message,
IAnalyticLogParameter messageParameters,
string component,
AnalyticsMessageTypes messageType)
{
return new LogObject(
severity.ToString(),
DateTime.UtcNow,
message,
messageParameters,
component,
messageType
);
}
}
}