Skip to content
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

made GraphStageLogic.LogSource virtual and change default StageLogic LogSource #5360

Merged

Conversation

Aaronontheweb
Copy link
Member

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})"

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})"
@Aaronontheweb
Copy link
Member Author

Aaronontheweb commented Nov 2, 2021

Here's the Shape.ToString() method implementation:

public bool HasSamePortsAndShapeAs(Shape shape) => Inlets.Equals(shape.Inlets) && Outlets.Equals(shape.Outlets);
/// <summary>
/// TBD
/// </summary>
/// <returns>TBD</returns>
public object Clone() => DeepCopy();
/// <inheritdoc/>
public sealed override string ToString() => $"{GetType().Name}([{string.Join(", ", Inlets)}] [{string.Join(", ", Outlets)}])";

Is this too noisy for the logs? cc @ismaelhamed

@Aaronontheweb Aaronontheweb changed the title made GraphStageLogic.LogSource virtual made GraphStageLogic.LogSource virtual and change default StageLogic LogSource Nov 2, 2021
erring on the side of less is more
@@ -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);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to just log the Shape.GetType here instead - less verbose this way.

Copy link
Contributor

@Arkatufus Arkatufus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Arkatufus Arkatufus enabled auto-merge (squash) November 5, 2021 17:53
@Arkatufus Arkatufus merged commit 7732fc7 into akkadotnet:dev Nov 5, 2021
This was referenced Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants