Skip to content

Commit

Permalink
Add IsLogDebug with Verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Apr 5, 2024
1 parent 552f227 commit 5c47ecb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Update `TestAdapter` with debug logs.
- Update `TestAdapter` with `PackageTags`
- Update `TestAdapter` with `PackageLicenseFile`
- Add `IsLogDebug` with `Verbosity`.


## [1.3.0] / 2024-03-28
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.3.1-rc</Version>
<Version>1.3.1-rc.1</Version>
</PropertyGroup>
</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
14 changes: 8 additions & 6 deletions ricaun.RevitTest.TestAdapter/TestExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ public void Cancel()
{
}

private static bool IsLogDebug => System.Diagnostics.Debugger.IsAttached || AdapterSettings.Settings.NUnit.Verbosity > 2;

/// <summary>
/// Run Tests using RevitTest.Console -t
/// </summary>
Expand Down Expand Up @@ -111,8 +113,8 @@ private async Task RunTests(IFrameworkHandle frameworkHandle, string source, Lis

if (item.StartsWith("{\"FileName"))
{
if (System.Diagnostics.Debugger.IsAttached)
AdapterLogger.Logger.Debug($"OutputConsole: Debug: {item.Trim()}");
if (IsLogDebug)
AdapterLogger.Logger.Debug($"OutputConsole: DEBUG: {item.Trim()}");

var testAssembly = item.Deserialize<TestAssemblyModel>();

Expand All @@ -126,8 +128,8 @@ private async Task RunTests(IFrameworkHandle frameworkHandle, string source, Lis
}
else if (item.StartsWith("{\"Name"))
{
if (System.Diagnostics.Debugger.IsAttached)
AdapterLogger.Logger.Debug($"OutputConsole: Debug: {item.Trim()}");
if (IsLogDebug)
AdapterLogger.Logger.Debug($"OutputConsole: DEBUG: {item.Trim()}");

if (item.Deserialize<TestModel>() is TestModel testModel)
{
Expand All @@ -141,8 +143,8 @@ private async Task RunTests(IFrameworkHandle frameworkHandle, string source, Lis
}
else
{
if (System.Diagnostics.Debugger.IsAttached)
AdapterLogger.Logger.Debug($"OutputConsole: Debug: {item}");
if (IsLogDebug)
AdapterLogger.Logger.Debug($"OutputConsole: DEBUG: {item}");
}
};

Expand Down

0 comments on commit 5c47ecb

Please sign in to comment.