Skip to content

Commit e6c7956

Browse files
Show hotkeys log on proxy start and after clear screen (#592)
* Show hotkeys log on proxy start and after clear screen. Extract common method for hotkeys logging * Use Console output to show messages in terminal if logger will be different in future * Update ProxyEngine.cs * Update ProxyEngine.cs --------- Co-authored-by: Waldek Mastykarz <[email protected]>
1 parent 2d5d996 commit e6c7956

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

dev-proxy/ProxyEngine.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public async Task Run(CancellationToken? cancellationToken)
150150
_logger.LogInformation("Configure your application to use this proxy's port and address");
151151
}
152152

153-
_logger.LogInformation("Press CTRL+C to stop Dev Proxy\r\n");
153+
PrintHotkeys();
154154
Console.CancelKeyPress += Console_CancelKeyPress;
155155

156156
if (_config.Record)
@@ -237,8 +237,7 @@ private void ReadKeys()
237237
if (key == ConsoleKey.C)
238238
{
239239
Console.Clear();
240-
Console.WriteLine("Press CTRL+C to stop Dev Proxy");
241-
Console.WriteLine("");
240+
PrintHotkeys();
242241
}
243242
if (key == ConsoleKey.W)
244243
{
@@ -590,4 +589,11 @@ Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e)
590589
// set e.clientCertificate to override
591590
return Task.CompletedTask;
592591
}
592+
593+
private void PrintHotkeys()
594+
{
595+
Console.WriteLine("Hotkeys: (r)ecord, (s)top recording, (c)lear screen");
596+
Console.WriteLine("Press CTRL+C to stop Dev Proxy");
597+
Console.WriteLine("");
598+
}
593599
}

0 commit comments

Comments
 (0)