Merged PR 1307: Make a log API consistent
This PR renames the log API `OnPopUnhandledEvent` to `OnPopStateWithUnhandledEvent` for consistency (e.g. we name `OnPopState` and not `OnPop`).
This commit is contained in:
Родитель
37e0ea5c9e
Коммит
08a81f19f9
|
@ -389,7 +389,7 @@ namespace Microsoft.Coyote.Actors
|
|||
await this.ExecuteCurrentStateOnExitAsync(null, e);
|
||||
if (this.CurrentStatus is Status.Active)
|
||||
{
|
||||
this.Runtime.LogWriter.LogPopUnhandledEvent(this.Id, this.CurrentStateName, e);
|
||||
this.Runtime.LogWriter.LogPopStateUnhandledEvent(this.Id, this.CurrentStateName, e);
|
||||
this.DoStatePop();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -220,13 +220,13 @@ namespace Microsoft.Coyote.Runtime.Logging
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual void OnPopUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
public virtual void OnPopStateUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
{
|
||||
string eventName = e.GetType().FullName;
|
||||
var reenteredStateName = string.IsNullOrEmpty(stateName)
|
||||
? string.Empty
|
||||
: $" and reentered state '{stateName}";
|
||||
var text = $"<PopLog> {id} popped with unhandled event '{eventName}'{reenteredStateName}.";
|
||||
var text = $"<PopLog> {id} popped its state due to unhandled event '{eventName}'{reenteredStateName}.";
|
||||
this.Logger.WriteLine(text);
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ namespace Microsoft.Coyote.Runtime
|
|||
/// <param name="id">The id of the actor that the pop executed in.</param>
|
||||
/// <param name="stateName">The state name, if the actor is a state machine and a state exists, else null.</param>
|
||||
/// <param name="e">The event that cannot be handled.</param>
|
||||
void OnPopUnhandledEvent(ActorId id, string stateName, Event e);
|
||||
void OnPopStateUnhandledEvent(ActorId id, string stateName, Event e);
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when the specified actor throws an exception.
|
||||
|
|
|
@ -345,13 +345,13 @@ namespace Microsoft.Coyote.Runtime
|
|||
/// <param name="id">The id of the actor that the pop executed in.</param>
|
||||
/// <param name="stateName">The state name, if the actor is a state machine and a state exists, else null.</param>
|
||||
/// <param name="e">The event that cannot be handled.</param>
|
||||
public void LogPopUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
public void LogPopStateUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
{
|
||||
if (this.Logs.Count > 0)
|
||||
{
|
||||
foreach (var log in this.Logs)
|
||||
{
|
||||
log.OnPopUnhandledEvent(id, stateName, e);
|
||||
log.OnPopStateUnhandledEvent(id, stateName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -250,7 +250,7 @@ namespace Microsoft.Coyote.TestingServices.Coverage
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void OnPopUnhandledEvent(ActorId actorId, string currStateName, Event e)
|
||||
public void OnPopStateUnhandledEvent(ActorId actorId, string currStateName, Event e)
|
||||
{
|
||||
if (e is HaltEvent)
|
||||
{
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace Microsoft.Coyote.Runtime.Logging
|
|||
this.Writer.WriteEndElement();
|
||||
}
|
||||
|
||||
public void OnPopUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
public void OnPopStateUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
{
|
||||
string eventName = e.GetType().FullName;
|
||||
this.Writer.WriteStartElement("PopUnhandled");
|
||||
|
|
|
@ -89,7 +89,7 @@ namespace Microsoft.Coyote.Tests.Common.Runtime
|
|||
{
|
||||
}
|
||||
|
||||
public void OnPopUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
public void OnPopStateUnhandledEvent(ActorId id, string stateName, Event e)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче