Skip to content

Commit 7a4c18d

Browse files
committed
f
1 parent 45578e7 commit 7a4c18d

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Requesting subnets from agent agentid_local1 (http://localhost:51515)
2+
Received subnet(s) from agent agentid_local1 (http://localhost:51515): 192.168.0.0/24
3+
4+
Scanning 1 subnet
5+
192.168.0.0/24 (254 addresses, estimated scan time is 00:00:05.0800000)
6+
7+
192.168.0.0/24 (1 devices)
8+
└── 192.168.0.100 11-11-11-11-11-11 Online (unknown device)

src/Cli/Commands/Scan/AgentSubnetProvider.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ CancellationToken cancellationToken
1515
)
1616
: ISubnetProvider {
1717
public async Task<List<CidrBlock>> GetAsync() {
18-
logger.LogInformation( "Getting subnets from agents" );
18+
logger.LogDebug( "Getting subnets from agents" );
1919
var allSubnets = new List<CidrBlock>();
2020

2121
foreach ( var agent in agents ) {
22-
logger.LogInformation( "Getting subnets from agent {Address}", agent.Address );
22+
logger.LogInformation( "Requesting subnets from agent {Id} ({Address})", agent.Id, agent.Address );
2323

2424
try {
2525
// await cluster.SendAsync( agent, new GiveMeSubnetsRequest(), CancellationToken.None );
@@ -32,8 +32,12 @@ public async Task<List<CidrBlock>> GetAsync() {
3232
);
3333

3434
allSubnets.AddRange( response.Subnets );
35-
logger.LogInformation( "Received {Count} subnets from {Address}: {Subnets}",
36-
response.Subnets.Count, agent.Address, string.Join( ", ", response.Subnets ) );
35+
logger.LogInformation(
36+
"Received subnet(s) from agent {Id} ({Address}): {Subnets}",
37+
response.Subnets.Count,
38+
agent.Address,
39+
string.Join( ", ", response.Subnets )
40+
);
3741
}
3842
catch ( Exception ex ) {
3943
logger.LogWarning( ex, "cluster.SendAsync failed", agent.Address );

src/Networking.PeerStreaming/PeerStreamManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ PeerMessageDispatcher dispatcher
1919
public PeerStream GetOrCreate( Uri peerAddress, string id ) {
2020
var agentId = new AgentId( id );
2121

22-
logger.LogInformation( "Getting or creating stream to agent {AgentId}", agentId );
22+
logger.LogDebug( "Getting or creating stream to agent {Id} ({Address})", agentId, peerAddress );
2323

2424
return _streams.GetOrAdd( agentId, _ => Create( peerAddress, agentId ) );
2525
}

0 commit comments

Comments
 (0)