Skip to content

Commit

Permalink
made GraphStageLogic.LogSource virtual and change default `StageLog…
Browse files Browse the repository at this point in the history
…ic` `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
  • Loading branch information
Aaronontheweb authored Nov 5, 2021
1 parent 048ea84 commit 7732fc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4640,7 +4640,7 @@ namespace Akka.Streams.Stage
protected GraphStageLogic(Akka.Streams.Shape shape) { }
public virtual bool KeepGoingAfterAllPortsClosed { get; }
public Akka.Event.ILoggingAdapter Log { get; }
protected object LogSource { get; }
protected virtual object LogSource { get; }
protected Akka.Streams.IMaterializer Materializer { get; }
public Akka.Streams.Stage.StageActor StageActor { get; }
[Akka.Annotations.ApiMayChangeAttribute()]
Expand Down
3 changes: 2 additions & 1 deletion src/core/Akka.Streams/Stage/GraphStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ protected GraphStageLogic(int inCount, int outCount)
/// <param name="shape">TBD</param>
protected GraphStageLogic(Shape shape) : this(shape.Inlets.Count(), shape.Outlets.Count())
{
LogSource = Akka.Event.LogSource.Create(shape);
}

/// <summary>
Expand Down Expand Up @@ -879,7 +880,7 @@ public StageActor StageActor
/// <summary>
/// Override to customise reported log source
/// </summary>
protected object LogSource => this;
protected virtual object LogSource { get; }

public ILoggingAdapter Log
{
Expand Down

0 comments on commit 7732fc7

Please sign in to comment.