Skip to content

Commit

Permalink
Merge pull request #33 from /issues/32
Browse files Browse the repository at this point in the history
Overide ToString() for Logging Scopes
  • Loading branch information
ckuetbach authored Jun 28, 2024
2 parents cdef24d + 3142625 commit fe56390
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;

namespace Dvelop.Sdk.Logging.Abstractions.Scope
{
Expand All @@ -18,5 +19,10 @@ public CustomAttributesLogScope(string name, Dictionary<string, object> items)
Name = name;
Items = items;
}

public override string ToString()
{
return $"CustomAttributesLogScope:{Name} => Items: {Items.Select(i=>i.Key + ":" + i.Value)+";"}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ public TenantLogScope(string tenantId)
{
TenantId = tenantId;
}

public override string ToString()
{
return $"TenantLogScope:TenantId:{TenantId}";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,10 @@ public TracingLogScope(string traceId, string spanId)
Trace = traceId;
Span = spanId;
}

public override string ToString()
{
return $"TenantLogScope:Trace{Trace}:{Span}";
}
}
}

0 comments on commit fe56390

Please sign in to comment.