Skip to content
This repository was archived by the owner on Feb 20, 2022. It is now read-only.

Commit b4e37c6

Browse files
committed
remove some Debug.Log and move Debug.Log to async for better debugging
1 parent b39db32 commit b4e37c6

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

unity-project/Assets/Moulin/DDP/ddp/DdpConnection.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,16 @@ public DdpConnection(string url) {
154154
private async void OnWebSocketOpen()
155155
{
156156
OnDebugMessage?.Invoke("Websocket open");
157-
Debug.Log("send connect...");
158157
await SendAsync(GetConnectMessage());
159-
Debug.Log("done sending connect");
160158

161-
Debug.Log("subscribe");
162159
foreach (Subscription subscription in subscriptions.Values)
163160
{
164161
await SendAsync(GetSubscriptionMessage(subscription));
165162
}
166-
Debug.Log("call methods");
167163
foreach (MethodCall methodCall in methodCalls.Values)
168164
{
169165
await SendAsync(GetMethodCallMessage(methodCall));
170166
}
171-
Debug.Log("onOpenDone");
172167
}
173168

174169
private void OnWebSocketError(string reason) {
@@ -209,7 +204,6 @@ private async Task HandleMessage(JSONObject message) {
209204
case MessageType.CONNECTED: {
210205
sessionId = message[Field.SESSION].str;
211206
ddpConnectionState = ConnectionState.CONNECTED;
212-
Debug.Log("SET STATE TO " + ddpConnectionState);
213207
OnConnected?.Invoke(this);
214208
break;
215209
}

unity-project/Assets/example/TestDdpAccount.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public async void Logout()
150150

151151
public void AddDebugText(string text)
152152
{
153+
Debug.Log(text);
153154
logQueue.Enqueue(text);
154155
}
155156

@@ -160,7 +161,6 @@ public void Update() {
160161
while (logQueue.Count > 0)
161162
{
162163
string log = logQueue.Dequeue();
163-
Debug.Log(log);
164164
string[] original = DebugText.text.Split('\n');
165165
List<string> logMessages = new List<string>();
166166
for (int i = 0; i < Mathf.Min(original.Length, 10); i++)

unity-project/Assets/example/TestDdpClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ public void CallAdd(int i, int j)
178178

179179
public void AddDebugText(string text)
180180
{
181+
Debug.Log(text);
181182
logQueue.Enqueue(text);
182183
}
183184

@@ -189,7 +190,6 @@ public void Update()
189190
while (logQueue.Count > 0)
190191
{
191192
string log = logQueue.Dequeue();
192-
Debug.Log(log);
193193
string[] original = DebugText.text.Split('\n');
194194
List<string> logMessages = new List<string>();
195195
for (int i = 0; i < Mathf.Min(original.Length, 10); i++)

0 commit comments

Comments
 (0)