akkadotnet/akka.net — pull request #454 by HCanber (2014-10-05 15:57:00+00:00)
Title: Replace LogAdapter with ILogger

As discussed in #448 this PR replaces usages of `LoggingAdapter` with `ILogger`.

`LoggingAdapter` is still used as an abstract class which `BusLogging` is based on but `ILogger` is now used in the public api.

In #448 it was suggested that we would add a method to Context to get a logger. I decided not to. I didn't think it was the reponsibility of `IActorContext` to create a logger. Instead I created an extension method in `Logger`, with the same effect. To make this as backward compatible as possible I didn't want to change the existing `GetLogger` into returning an `ILogger` so the new methods are called `CreateLogger` which in a way is better, since a call to them actually creates a new instance every time.

With this PR merged the user may write this in an actor.
``` c#
public class MyActor : ActorBase
{
private readonly ILogger _log = Context.CreateLogger();
...
}
```

I removed (obsoleted if that is a verb :) `IActorLogging`. It corresponds to the trait `ActorLogging` in Akka JVM which adds a lazy evaulated log property. Ours just forced the user to implement a Log property, which the user had to set itself, so the interface didn't bring any real value.

## Breaking Changes
Unfortunately breaking changes had to be made.
Log property on these classes has been changed from `LoggingAdapter` to `ILogger`
- FSM
- InboxActor
- RemoteWatcher

I would not expect that that much code breaks. As `ILogger` is compatible with `LoggingAdapter` this kind of usages will not break:
```C#
//Inside an FSM
public class MyFsm : FSM<...>
{
...
Log.Debug(...);
}
```

Any assignment where `LoggingAdapter` is explicitly specified will break:
```C#
//Inside an FSM
public class MyFsm : FSM<...>
{
...
LoggingAdapter log=Log;
}
```