Skip to content

Commit 98c38dc

Browse files
committed
Clean up tests and code
1 parent 92af4ff commit 98c38dc

3 files changed

Lines changed: 32 additions & 18 deletions

File tree

36 Bytes
Binary file not shown.

Assets/UnityFileDebug/Demo/Tester.cs

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,32 @@
22
using System.Collections;
33
using System;
44

5-
public class Tester : MonoBehaviour {
6-
7-
// Use this for initialization
8-
void Start () {
9-
10-
}
11-
12-
// Update is called once per frame
13-
void Update () {
5+
public class Tester : MonoBehaviour
6+
{
7+
void Update()
8+
{
149
Debug.Log("Test", DLogType.AI);
15-
10+
Debug.Log("Test", DLogType.Assert);
11+
Debug.Log("Test", DLogType.Audio);
12+
Debug.Log("Test", DLogType.Content);
13+
Debug.Log("Test", DLogType.Error);
14+
Debug.Log("Test", DLogType.Exception);
15+
Debug.Log("Test", DLogType.GUI);
16+
Debug.Log("Test", DLogType.Input);
17+
Debug.Log("Test", DLogType.Log);
18+
Debug.Log("Test", DLogType.Logic);
19+
Debug.Log("Test", DLogType.Network);
20+
Debug.Log("Test", DLogType.Physics);
21+
Debug.Log("Test", DLogType.System);
22+
Debug.Log("Test", DLogType.Warning);
1623
Debug.Log("Test with a super dooper long name akjlsdf klajsd lfkjads flkjasd flkjasdf ljkasdl fkjasl kfjasdlkf jasl fjaslk fjasldjf klasjfd lkasjdf klasjfd klsjadf klasjfd lkasjdf klasjdf ;lkasjfd lksajd fk", DLogType.Log);
17-
Debug.LogFormat("<color=green>This is a green message!</color>");
18-
}
24+
25+
Debug.Assert(true == false);
26+
Debug.Assert(true == false, "true equals false");
27+
Debug.LogWarning("Warning");
28+
Debug.LogError("Error");
29+
Debug.LogAssertion("Conditionless assertion");
30+
31+
Debug.LogFormat("<color=green>This is a green message!</color>");
32+
}
1933
}

Assets/UnityFileDebug/Lib/UnityFileDebug.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public class UnityFileDebug : MonoBehaviour
1515
public bool showTime = false;
1616
public bool useAbsolutePath = false;
1717
public string fileName = "MyGame";
18-
18+
1919
public string absolutePath = "c:\\";
20-
20+
2121
public string filePath;
2222
public string filePathFull;
2323
public int count = 0;
@@ -50,7 +50,7 @@ void OnDisable()
5050
{
5151
Application.logMessageReceived -= HandleLog;
5252
fileWriter.WriteLine("\n]");
53-
fileWriter.Close();
53+
fileWriter.Close();
5454
}
5555
}
5656

@@ -71,10 +71,10 @@ void HandleLog(string logString, string stackTrace, LogType type)
7171
else
7272
{
7373
int end = logString.IndexOf("]");
74-
j.t = logString.Substring(1, end-1);
74+
j.t = logString.Substring(1, end - 1);
7575
j.l = logString.Substring(end + 2);
7676
}
77-
77+
7878
j.s = stackTrace;
7979
j.tm = System.DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss");
8080

@@ -160,6 +160,6 @@ public static class Debug
160160

161161
#region Warning
162162
public static void LogWarning(object message, DLogType type = DLogType.Warning) { UnityEngine.Debug.LogWarning("[" + type + "] " + message); }
163-
public static void LogWarning(object message, Object context, DLogType type = DLogType.Warning) { UnityEngine.Debug.LogWarning("[" + type + "] " + message, context); }
163+
public static void LogWarning(object message, Object context, DLogType type = DLogType.Warning) { UnityEngine.Debug.LogWarning("[" + type + "] " + message, context); }
164164
#endregion
165165
}

0 commit comments

Comments
 (0)