Skip to content

Commit

Permalink
feat(ServiceDiscovery): when tracing pretty print the DNS message
Browse files Browse the repository at this point in the history
  • Loading branch information
richardschneider committed Apr 24, 2019
1 parent c711242 commit a53d99d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Mdns.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ItemGroup>
<PackageReference Include="Common.Logging" Version="3.4.1" />
<PackageReference Include="IPNetwork2" Version="2.1.2" />
<PackageReference Include="Makaretu.Dns" Version="1.2.0" />
<PackageReference Include="Makaretu.Dns" Version="1.3.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard14'">
Expand Down
12 changes: 10 additions & 2 deletions src/ServiceDiscovery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ void OnQuery(object sender, MessageEventArgs e)

if (log.IsDebugEnabled)
{
log.Debug($"got query from: {e.RemoteEndPoint}, for {request.Questions[0].Name} {request.Questions[0].Type}");
log.Debug($"Query from {e.RemoteEndPoint}");
}
if (log.IsTraceEnabled)
{
log.Trace(request);
}

// Determine if this query is requesting a unicast response
Expand Down Expand Up @@ -274,7 +278,11 @@ void OnQuery(object sender, MessageEventArgs e)

if (log.IsDebugEnabled)
{
log.Debug($"sent answer {response.Answers[0]}");
log.Debug($"Sending answer");
}
if (log.IsTraceEnabled)
{
log.Trace(response);
}
//Console.WriteLine($"Response time {(DateTime.Now - request.CreationTime).TotalMilliseconds}ms");
}
Expand Down

0 comments on commit a53d99d

Please # to comment.