forked from andyburke/UnityHTTP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.cs
More file actions
71 lines (70 loc) · 1.53 KB
/
Copy pathLogger.cs
File metadata and controls
71 lines (70 loc) · 1.53 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
using System;
namespace UnityHTTP
{
public interface ILogger
{
void Log(string msg);
void LogError(string msg);
void LogException(Exception e);
void LogWarning(string msg);
}
#if UNITY_EDITOR
public class UnityLogger : ILogger
{
public void Log(string msg)
{
UnityEngine.Debug.Log(msg);
}
public void LogError(string msg)
{
UnityEngine.Debug.LogError(msg);
}
public void LogException(Exception e)
{
UnityEngine.Debug.LogException(e);
}
public void LogWarning(string msg)
{
UnityEngine.Debug.LogWarning(msg);
}
}
#endif
public class ConsoleLogger : ILogger
{
public void Log(string msg)
{
Console.WriteLine(msg);
}
public void LogError(string msg)
{
Console.WriteLine(msg);
}
public void LogException(Exception e)
{
Console.WriteLine(e);
}
public void LogWarning(string msg)
{
Console.WriteLine(msg);
}
}
public class DiscardLogger : ILogger
{
public void Log(string msg)
{
// discard logs
}
public void LogError(string msg)
{
// discard logs
}
public void LogException(Exception e)
{
// discard logs
}
public void LogWarning(string msg)
{
// discard logs
}
}
}