@@ -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