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

Warning about JSON.NET obsolete in v1.5 #1811

Merged
merged 1 commit into from
Mar 25, 2016
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
19 changes: 18 additions & 1 deletion src/core/Akka/Actor/Internal/ActorSystemImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Akka.Dispatch;
using Akka.Dispatch.SysMsg;
using Akka.Event;
using Akka.Serialization;
using Akka.Util;


Expand Down Expand Up @@ -106,14 +107,30 @@ public void Start()
_logDeadLetterListener = SystemActorOf<DeadLetterListener>("deadLetterListener");

_eventStream.StartUnsubscriber(this);


WarnIfJsonIsDefaultSerializer();

if (_settings.LogConfigOnStart)
{
_log.Warning(Settings.ToString());
}
}

private void WarnIfJsonIsDefaultSerializer()
{
const string configPath = "akka.suppress-json-serializer-warning";
var showSerializerWarning = Settings.Config.HasPath(configPath) && !Settings.Config.GetBoolean(configPath);

if (showSerializerWarning &&
Serialization.FindSerializerForType(typeof (object)) is NewtonSoftJsonSerializer)
{
Log.Warning($"NewtonSoftJsonSerializer has been detected as a default serializer. " +
$"It will be obsoleted in Akka.NET starting from version 1.5 in the favor of Wire " +
$"(for more info visit: http://getakka.net/docs/Serialization#how-to-setup-wire-as-default-serializer ). " +
$"If you want to suppress this message set HOCON `{configPath}` config flag to on.");
}
}

public override IActorRef ActorOf(Props props, string name = null)
{
return _provider.Guardian.Cell.ActorOf(props, name: name);
Expand Down
4 changes: 4 additions & 0 deletions src/core/Akka/Configuration/Pigeon.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ akka {
# as they have been started; before that, see "stdout-loglevel"
# Options: OFF, ERROR, WARNING, INFO, DEBUG
loglevel = "INFO"

# Suppresses warning about usage of the default (JSON.NET) serializer
# which is going to be obsoleted at v1.5
suppress-json-serializer-warning = off

# Log level for the very basic logger activated during AkkaApplication startup
# Options: OFF, ERROR, WARNING, INFO, DEBUG
Expand Down