-
Notifications
You must be signed in to change notification settings - Fork 62
/
TestUberLogger.cs
executable file
·82 lines (70 loc) · 3.05 KB
/
TestUberLogger.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using UnityEngine;
using System.Collections.Generic;
using System.Threading;
public class TestUberLogger : MonoBehaviour
{
Thread TestThread;
// Use this for initialization
void Start ()
{
UberLogger.Logger.AddLogger(new UberLoggerFile("UberLogger.log"), false);
DoTest();
TestThread = new Thread(new ThreadStart(TestThreadEntry));
TestThread.Start();
//Test an internal .Net OOB error
var t = new List<int>();
t[0] = 5;
}
void OnDestroy()
{
TestThread.Abort();
TestThread.Join();
}
void TestThreadEntry()
{
for(;;)
{
Debug.Log("Thread Log Message");
UberDebug.Log("Thread ULog Message");
Thread.Sleep(100);
}
}
public void DoTest()
{
// UnityEngine.Debug.Log("Starting");
Debug.LogWarning("Log Warning with GameObject", gameObject);
Debug.LogError("Log Error with GameObject", gameObject);
Debug.Log("Log Message with GameObject", gameObject);
Debug.LogFormat("Log Format param {0}", "Test");
Debug.LogFormat(gameObject, "Log Format with GameObject and param {0}", "Test");
UberDebug.Log("ULog");
UberDebug.Log("ULog with param {0}", "Test");
UberDebug.Log(gameObject, "ULog with GameObject");
UberDebug.Log(gameObject, "ULog with GameObject and param {0}", "Test");
UberDebug.LogChannel("Test", "ULogChannel");
UberDebug.LogChannel("Test", "ULogChannel with param {0}", "Test");
UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject");
UberDebug.LogChannel(gameObject, "Test", "ULogChannel with GameObject and param {0}", "Test");
UberDebug.LogWarning("ULogWarning");
UberDebug.LogWarning("ULogWarning with param {0}", "Test");
UberDebug.LogWarning(gameObject, "ULogWarning with GameObject");
UberDebug.LogWarning(gameObject, "ULogWarning with GameObject and param {0}", "Test");
UberDebug.LogWarningChannel("Test", "ULogWarningChannel");
UberDebug.LogWarningChannel("Test", "ULogWarningChannel with param {0}", "Test");
UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject");
UberDebug.LogWarningChannel(gameObject, "Test", "ULogWarningChannel with GameObject and param {0}", "Test");
UberDebug.LogError("ULogError");
UberDebug.LogError("ULogError with param {0}", "Test");
UberDebug.LogError(gameObject, "ULogError with GameObject");
UberDebug.LogError(gameObject, "ULogError with GameObject and param {0}", "Test");
UberDebug.LogErrorChannel("Test", "ULogErrorChannel");
UberDebug.LogErrorChannel("Test", "ULogErrorChannel with param {0}", "Test");
UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject");
UberDebug.LogErrorChannel(gameObject, "Test", "ULogErrorChannel with GameObject and param {0}", "Test");
}
// Update is called once per frame
void Update ()
{
// DoTest();
}
}