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

More interface prefixing #801

Merged
merged 4 commits into from
Apr 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/contrib/loggers/Akka.Logger.NLog/NLogLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Akka.Logger.NLog
{
public class NLogLogger : ReceiveActor
{
private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

private static void Log(LogEvent logEvent, Action<NLogger> logStatement)
{
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/loggers/Akka.Logger.Serilog/SerilogLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Akka.Logger.Serilog
{
public class SerilogLogger : ReceiveActor
{
private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

private void WithSerilog(Action<ILogger> logStatement)
{
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/loggers/Akka.Logger.slf4net/Slf4jLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Slf4NetLogger : UntypedActor
//private string mdcAkkaSourceAttributeName = "akkaSource";
//private string mdcAkkaTimestamp = "akkaTimestamp";

private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

private void WithMDC(Action<ILogger> logStatement)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/AutoDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,6 @@ private void Remove(UniqueAddress node)
_pendingUnreachable = _pendingUnreachable.Remove(node);
}

public LoggingAdapter Log { get; private set; }
public ILoggingAdapter Log { get; private set; }
}
}
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public ImmutableHashSet<string> SelfRoles

internal ActorSystemImpl System { get; private set; }

readonly LoggingAdapter _log;
readonly ILoggingAdapter _log;
readonly ClusterReadView _readView;
public ClusterReadView ReadView {get { return _readView; }}

Expand Down
12 changes: 6 additions & 6 deletions src/core/Akka.Cluster/ClusterDaemon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ protected override void OnReceive(object message)
});
}

private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();
}

/// <summary>
Expand All @@ -594,7 +594,7 @@ class ClusterCoreSupervisor : ReceiveActor
readonly IActorRef _publisher;
readonly IActorRef _coreDaemon;

private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

public ClusterCoreSupervisor()
{
Expand Down Expand Up @@ -1708,7 +1708,7 @@ public void PublishInternalStats()
_publisher.Tell(new ClusterEvent.CurrentInternalStats(_gossipStats, vclockStats));
}

readonly LoggingAdapter _log = Context.GetLogger();
readonly ILoggingAdapter _log = Context.GetLogger();
}

/// <summary>
Expand Down Expand Up @@ -1737,7 +1737,7 @@ public void PublishInternalStats()
/// </summary>
internal sealed class JoinSeedNodeProcess : UntypedActor
{
readonly LoggingAdapter _log = Context.GetLogger();
readonly ILoggingAdapter _log = Context.GetLogger();

readonly ImmutableList<Address> _seeds;
readonly Address _selfAddress;
Expand Down Expand Up @@ -1812,7 +1812,7 @@ private void Done(object message)
/// </summary>
internal sealed class FirstSeedNodeProcess : UntypedActor
{
readonly LoggingAdapter _log = Context.GetLogger();
readonly ILoggingAdapter _log = Context.GetLogger();

private ImmutableList<Address> _remainingSeeds;
readonly Address _selfAddress;
Expand Down Expand Up @@ -1970,7 +1970,7 @@ public GossipStats Copy(long? receivedGossipCount = null,
class OnMemberUpListener : ReceiveActor
{
readonly Action _callback;
readonly LoggingAdapter _log = Context.GetLogger();
readonly ILoggingAdapter _log = Context.GetLogger();
readonly Cluster _cluster;

public OnMemberUpListener(Action callback)
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/ClusterHeartbeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public IFailureDetectorRegistry<Address> FailureDetector

private readonly Cluster _cluster;

private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

public ClusterHeartbeatSender()
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Cluster/ClusterMetricsCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Akka.Cluster
/// </summary>
internal class ClusterMetricsCollector : ReceiveActor
{
private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

/// <summary>
/// The node ring gossiped that contains only members that are <see cref="MemberStatus.Up"/>
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.FSharp/FsApi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module Actors =
/// <summary>
/// Lazy logging adapter. It won't be initialized until logging function will be called.
/// </summary>
abstract Log : Lazy<Akka.Event.LoggingAdapter>
abstract Log : Lazy<Akka.Event.ILoggingAdapter>

/// <summary>
/// Defers provided function to be invoked when actor stops, regardless of reasons.
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Persistence.FSharp/FsApi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Eventsourced<'Command, 'Event, 'State> =
/// <summary>
/// Lazy logging adapter. It won't be initialized until logging function will be called.
/// </summary>
abstract Log : Lazy<Akka.Event.LoggingAdapter>
abstract Log : Lazy<Akka.Event.ILoggingAdapter>

/// <summary>
/// Defers a function execution to the moment, when actor is suposed to end it's lifecycle.
Expand Down Expand Up @@ -181,7 +181,7 @@ type View<'Event, 'State> =
/// <summary>
/// Lazy logging adapter. It won't be initialized until logging function will be called.
/// </summary>
abstract Log : Lazy<Akka.Event.LoggingAdapter>
abstract Log : Lazy<Akka.Event.ILoggingAdapter>

/// <summary>
/// Defers a function execution to the moment, when actor is suposed to end it's lifecycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public SendingMessage(long deliveryId, bool isRecovering)
internal class CrashingActor : GuaranteedDeliveryActor
{
private readonly IActorRef _testProbe;
private LoggingAdapter _adapter;
private ILoggingAdapter _adapter;

LoggingAdapter Log { get { return _adapter ?? (_adapter = Context.GetLogger()); } }
ILoggingAdapter Log { get { return _adapter ?? (_adapter = Context.GetLogger()); } }

public CrashingActor(IActorRef testProbe)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ internal class ChaosSender : GuaranteedDeliveryActor
private readonly Config _config;
private readonly double _liveProcessingFailureRate;
private readonly double _replayProcessingFailureRate;
private LoggingAdapter _log;
private ILoggingAdapter _log;

public LoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); }}
public ILoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); }}

public ChaosSender(IActorRef destination, IActorRef probe)
{
Expand Down Expand Up @@ -237,9 +237,9 @@ internal class ChaosDestination : ReceiveActor, IChaosSupport
{
private readonly Config _config;
private readonly double _confirmFailureRate;
private LoggingAdapter _log;
private ILoggingAdapter _log;

public LoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); } }
public ILoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); } }

public ChaosDestination(IActorRef probe)
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Persistence.Tests/GuaranteedDeliverySpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Sender : GuaranteedDeliveryActor
private readonly int _redeliveryBurstLimit;
private readonly bool _isAsync;
private readonly IDictionary<string, ActorPath> _destinations;
private readonly LoggingAdapter _log;
private readonly ILoggingAdapter _log;
private IActorRef _lastSnapshotAskedForBy;

public Sender(IActorRef testActor, string name, TimeSpan redeliverInterval, int warn, int redeliveryBurstLimit, bool isAsync, IDictionary<string, ActorPath> destinations)
Expand Down
4 changes: 2 additions & 2 deletions src/core/Akka.Persistence/Snapshot/LocalSnapshotStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public LocalSnapshotStore()
private readonly StoreSettings _settings;
public StoreSettings Settings { get { return _settings; } }

private LoggingAdapter _log;
public LoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); } }
private ILoggingAdapter _log;
public ILoggingAdapter Log { get { return _log ?? (_log = Context.GetLogger()); } }

protected override void PreStart()
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Remote.TestKit/BarrierCoordinator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public BarrierCoordinator()

//this shall be set to true if all subsequent barriers shall fail
private bool _failed = false;
private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();

protected override void PreRestart(Exception reason, object message) { }
protected override void PostRestart(Exception reason)
Expand Down
6 changes: 3 additions & 3 deletions src/core/Akka.Remote.TestKit/Conductor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ public Task<Done> RemoveNode(RoleName node)
/// </summary>
internal class ConductorHandler : IHeliosConnectionHandler
{
private readonly LoggingAdapter _log;
private readonly ILoggingAdapter _log;
private readonly IActorRef _controller;
private readonly ConcurrentDictionary<IConnection, IActorRef> _clients = new ConcurrentDictionary<IConnection, IActorRef>();

public ConductorHandler(IActorRef controller, LoggingAdapter log)
public ConductorHandler(IActorRef controller, ILoggingAdapter log)
{
_controller = controller;
_log = log;
Expand Down Expand Up @@ -309,7 +309,7 @@ public void OnException(Exception ex, IConnection erroredChannel)
/// </summary>
class ServerFSM : FSM<ServerFSM.State, IActorRef>, ILoggingFSM
{
private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();
readonly RemoteConnection _channel;
readonly IActorRef _controller;
RoleName _roleName;
Expand Down
2 changes: 1 addition & 1 deletion src/core/Akka.Remote.TestKit/MultiNodeSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ private static string GetCallerName()

readonly RoleName _myself;
public RoleName Myself { get { return _myself; } }
readonly LoggingAdapter _log;
readonly ILoggingAdapter _log;
readonly ImmutableList<RoleName> _roles;
readonly Func<RoleName, ImmutableList<string>> _deployments;
readonly ImmutableDictionary<RoleName, Replacement> _replacements;
Expand Down
6 changes: 3 additions & 3 deletions src/core/Akka.Remote.TestKit/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static Disconnected Instance
}
}

private readonly LoggingAdapter _log = Context.GetLogger();
private readonly ILoggingAdapter _log = Context.GetLogger();
readonly TestConductorSettings _settings;
readonly PlayerHandler _handler;
readonly RoleName _name;
Expand Down Expand Up @@ -512,14 +512,14 @@ class PlayerHandler : IHeliosConnectionHandler
readonly TimeSpan _backoff;
readonly int _poolSize;
readonly IActorRef _fsm;
readonly LoggingAdapter _log;
readonly ILoggingAdapter _log;
readonly IScheduler _scheduler;
private bool _loggedDisconnect = false;

Deadline _nextAttempt;

public PlayerHandler(INode server, int reconnects, TimeSpan backoff, int poolSize, IActorRef fsm,
LoggingAdapter log, IScheduler scheduler)
ILoggingAdapter log, IScheduler scheduler)
{
_server = server;
_reconnects = reconnects;
Expand Down
Loading