-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDebugLogger.cs
66 lines (57 loc) · 1.77 KB
/
DebugLogger.cs
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
using RSG.Utils;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
namespace RSG.UnityApp.Internal
{
/// <summary>
/// A simple debug logger.
/// </summary>
public class DebugLogger : ILogger
{
/// <summary>
/// Log an error message.
/// </summary>
/// <param name="message"></param>
public void LogError(string message, params object[] args)
{
Trace.WriteLine("[Error]: " + message);
Console.WriteLine("[Error]: " + message);
}
/// <summary>
/// Log an error caused by an exception.
/// </summary>
public void LogError(Exception ex, string message, params object[] args)
{
Trace.WriteLine("[Error]: " + message);
Trace.WriteLine(ex.ToString());
Console.WriteLine("[Error]: " + message);
Console.WriteLine(ex.ToString());
}
/// <summary>
/// Log a warning message.
/// </summary>
public void LogWarning(string message, params object[] args)
{
Trace.WriteLine("[Warning]: " + message);
Console.WriteLine("[Warning]: " + message);
}
/// <summary>
/// Log an info message.
/// </summary>
public void LogInfo(string message, params object[] args)
{
Trace.WriteLine(message);
Console.WriteLine(message);
}
/// <summary>
/// Log a verbose message, disabled by default.
/// </summary>
public void LogVerbose(string message, params object[] args)
{
LogInfo(message);
}
}
}