Skip to content

Use Debugger.IsAttached to affect default for debug mode #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Temporalio/Worker/TemporalWorkerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Temporalio.Activities;
Expand Down Expand Up @@ -215,7 +216,8 @@ public TemporalWorkerOptions()

/// <summary>
/// Gets or sets a value indicating whether deadlock detection will be disabled for all
/// workflows. If unset, this value defaults to true only if the <c>TEMPORAL_DEBUG</c>
/// workflows. If unset, this value defaults to true only if
/// <see cref="Debugger.IsAttached" /> is <c>true</c> or the <c>TEMPORAL_DEBUG</c>
/// environment variable is <c>true</c> or <c>1</c>.
/// </summary>
/// <remarks>
Expand All @@ -225,7 +227,8 @@ public TemporalWorkerOptions()
/// </remarks>
public bool DebugMode { get; set; } =
string.Equals(DebugModeEnvironmentVariable, "true", StringComparison.OrdinalIgnoreCase) ||
DebugModeEnvironmentVariable == "1";
DebugModeEnvironmentVariable == "1" ||
Debugger.IsAttached;

/// <summary>
/// Gets or sets a value indicating whether workflow tracing event listener will be disabled
Expand Down