-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workflow replay-safe logger (#1434)
* Removed obsolete type Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added missing using Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Adding interface for IWorkflowContext for replayability concerns Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed unused IConfiguration Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added ReplaySafeLogger type Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Building out functionality to expose ReplayLogger in workflow context Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added license information to file Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed unnecessary file Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Updated copyright header for different project, made some tweaks for nullability errors Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added virtual methods that use the already-available ILoggerFactory to create the ReplaySafeLogger on the WorkflowContext Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed unnecessary registration Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Updated example to demonstrate using ReplaySafeLogger in the orchestration context Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Tweaks on visibility and abstraction so that the methods are available in the context made visible to workflow developers Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed obsolete type registrations Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Simplified argument null check Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed since-removed code leftover from merge Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Added documentation demonstrating how to access the replay-safe logger Signed-off-by: Whit Waldo <whit.waldo@innovian.net> * Removed unnecessary and separate ReplaySafeLogger in favor of method to create it off the TaskOrchestrationContext (innerContext) Signed-off-by: Whit Waldo <whit.waldo@innovian.net> --------- Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
- Loading branch information
Showing
8 changed files
with
148 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace Dapr.Workflow; | ||
|
||
/// <summary> | ||
/// Provides functionality available to orchestration code. | ||
/// </summary> | ||
public interface IWorkflowContext | ||
{ | ||
/// <summary> | ||
/// Gets a value indicating whether the orchestration or operation is currently replaying itself. | ||
/// </summary> | ||
/// <remarks> | ||
/// This property is useful when there is logic that needs to run only when *not* replaying. For example, | ||
/// certain types of application logging may become too noisy when duplicated as part of replay. The | ||
/// application code could check to see whether the function is being replayed and then issue | ||
/// the log statements when this value is <c>false</c>. | ||
/// </remarks> | ||
/// <value> | ||
/// <c>true</c> if the orchestration or operation is currently being replayed; otherwise <c>false</c>. | ||
/// </value> | ||
bool IsReplaying { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters