Skip to content

Commit 136e289

Browse files
committed
Remove log lines
1 parent 5e41c0c commit 136e289

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

com.unity.netcode.gameobjects/Runtime/Logging/ContextualLogger.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public ContextualLogger(Object inspectorObject, [NotNull] NetworkManager network
6060
}
6161

6262
/// Used for the NetworkLog
63-
internal ContextualLogger(NetworkManager networkManager, bool useCompatibilityMode)
63+
internal ContextualLogger(NetworkManager networkManager, bool useCompatibilityMode = false)
6464
{
6565
m_UseCompatibilityMode = useCompatibilityMode;
6666
m_ManagerContext = new LogContextNetworkManager(networkManager);
@@ -207,7 +207,6 @@ internal DisposableContext(ContextualLogger logger, string toClear)
207207

208208
public void Dispose()
209209
{
210-
Debug.Log($"Disposing disposable value: {m_ToClear}");
211210
m_Logger.RemoveInfo(m_ToClear);
212211
}
213212
}

com.unity.netcode.gameobjects/Runtime/Logging/LogContext/GenericContext.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ namespace Unity.Netcode.Logging
66
{
77
internal readonly struct GenericContext : ILogContext, IDisposable
88
{
9-
private readonly List<string> m_Contexts;
9+
private readonly List<string> m_Tags;
1010
private readonly Dictionary<object, object> m_Info;
1111

12-
private GenericContext(List<string> contexts, Dictionary<object, object> info)
12+
private GenericContext(List<string> tags, Dictionary<object, object> info)
1313
{
14-
m_Contexts = contexts;
14+
m_Tags = tags;
1515
m_Info = info;
1616
}
1717

1818
public void AppendTo(LogBuilder builder)
1919
{
20-
if (m_Contexts != null)
20+
if (m_Tags != null)
2121
{
22-
foreach (var ctx in m_Contexts)
22+
foreach (var ctx in m_Tags)
2323
{
2424
builder.AppendTag(ctx);
2525
}
@@ -34,27 +34,26 @@ public void AppendTo(LogBuilder builder)
3434
}
3535
}
3636

37-
public void StoreTag(string msg)
37+
public void StoreTag(string tag)
3838
{
39-
m_Contexts.Add(msg);
39+
m_Tags.Add(tag);
4040
}
4141

4242
public void StoreInfo(object key, object value)
4343
{
44-
if (m_Info.TryGetValue(key, out var currentValue))
45-
{
46-
Debug.Log($"Adding info: {key}={value}. Existing value: {currentValue}");
47-
m_Info[key] = value;
48-
return;
49-
}
5044
m_Info.Add(key, value);
5145
}
5246

53-
public void ClearInfo(object key)
47+
public void RemoveInfo(object key)
5448
{
5549
m_Info?.Remove(key);
5650
}
5751

52+
public void RemoveTag(string tag)
53+
{
54+
m_Tags?.Remove(tag);
55+
}
56+
5857
public void Dispose()
5958
{
6059
PreallocatedStore.Free(this);
@@ -83,7 +82,7 @@ internal static GenericContext GetPreallocated()
8382

8483
internal static void Free(GenericContext ctx)
8584
{
86-
ctx.m_Contexts.Clear();
85+
ctx.m_Tags.Clear();
8786
ctx.m_Info.Clear();
8887
k_Preallocated.Enqueue(ctx);
8988
}

0 commit comments

Comments
 (0)