forked from sshnet/SSH.NET
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSshNetLoggingConfiguration.cs
More file actions
38 lines (34 loc) · 1.22 KB
/
SshNetLoggingConfiguration.cs
File metadata and controls
38 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#nullable enable
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Renci.SshNet.Common;
namespace Renci.SshNet
{
/// <summary>
/// Allows configuring the logging for internal logs of SSH.NET.
/// </summary>
public static class SshNetLoggingConfiguration
{
internal static ILoggerFactory LoggerFactory { get; private set; } = NullLoggerFactory.Instance;
/// <summary>
/// Initializes the logging for SSH.NET.
/// </summary>
/// <param name="loggerFactory">The logger factory.</param>
public static void InitializeLogging(ILoggerFactory loggerFactory)
{
ThrowHelper.ThrowIfNull(loggerFactory);
LoggerFactory = loggerFactory;
}
#if DEBUG
/// <summary>
/// Gets or sets the path to which to write session secrets which
/// Wireshark can read and use to inspect encrypted traffic.
/// </summary>
/// <remarks>
/// To configure in Wireshark, go to Edit -> Preferences -> Protocols
/// -> SSH and set the same value for "Key log filename".
/// </remarks>
public static string? WiresharkKeyLogFilePath { get; set; }
#endif
}
}