Skip to content

Commit 54d0162

Browse files
Enable trace logging for Integration tests (#1242)
1 parent 5021f6d commit 54d0162

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/Renci.SshNet.IntegrationTests/TestsFixtures/InfrastructureFixture.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
using DotNet.Testcontainers.Builders;
1+
using System.Diagnostics;
2+
3+
using DotNet.Testcontainers.Builders;
24
using DotNet.Testcontainers.Containers;
35
using DotNet.Testcontainers.Images;
46

7+
using Renci.SshNet.Abstractions;
8+
59
namespace Renci.SshNet.IntegrationTests.TestsFixtures
610
{
711
public sealed class InfrastructureFixture : IDisposable
@@ -34,6 +38,10 @@ public static InfrastructureFixture Instance
3438

3539
public async Task InitializeAsync()
3640
{
41+
DiagnosticAbstraction.Source.Switch = new SourceSwitch("sourceSwitch", "Verbose");
42+
DiagnosticAbstraction.Source.Listeners.Remove("Default");
43+
DiagnosticAbstraction.Source.Listeners.Add(new ConsoleTraceListener());
44+
3745
_sshServerImage = new ImageFromDockerfileBuilder()
3846
.WithName("renci-ssh-tests-server-image")
3947
.WithDockerfileDirectory(CommonDirectoryPath.GetSolutionDirectory(), Path.Combine("test", "Renci.SshNet.IntegrationTests"))

0 commit comments

Comments
 (0)