Skip to content

Commit 7732fc7

Browse files
made GraphStageLogic.LogSource virtual and change default StageLogic LogSource (#5360)
* made `GraphStageLogic.LogSource` virtual Also, changed the default `LogSource` to be the output of the `Stage.ToString()` method. Right now all `GraphStageLogic` log sources default to just "Logic (akka://{ActorSystemName})" * changed the LogSource to be just the Stage `Type` erring on the side of less is more
1 parent 048ea84 commit 7732fc7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/core/Akka.API.Tests/CoreAPISpec.ApproveStreams.approved.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4640,7 +4640,7 @@ namespace Akka.Streams.Stage
46404640
protected GraphStageLogic(Akka.Streams.Shape shape) { }
46414641
public virtual bool KeepGoingAfterAllPortsClosed { get; }
46424642
public Akka.Event.ILoggingAdapter Log { get; }
4643-
protected object LogSource { get; }
4643+
protected virtual object LogSource { get; }
46444644
protected Akka.Streams.IMaterializer Materializer { get; }
46454645
public Akka.Streams.Stage.StageActor StageActor { get; }
46464646
[Akka.Annotations.ApiMayChangeAttribute()]

src/core/Akka.Streams/Stage/GraphStage.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ protected GraphStageLogic(int inCount, int outCount)
839839
/// <param name="shape">TBD</param>
840840
protected GraphStageLogic(Shape shape) : this(shape.Inlets.Count(), shape.Outlets.Count())
841841
{
842+
LogSource = Akka.Event.LogSource.Create(shape);
842843
}
843844

844845
/// <summary>
@@ -879,7 +880,7 @@ public StageActor StageActor
879880
/// <summary>
880881
/// Override to customise reported log source
881882
/// </summary>
882-
protected object LogSource => this;
883+
protected virtual object LogSource { get; }
883884

884885
public ILoggingAdapter Log
885886
{

0 commit comments

Comments
 (0)