Serialization Docs: add info about adding a logger (#22618)

This commit is contained in:
Sebastian Harko 2017-03-30 11:31:18 +02:00 committed by Johan Andrén
parent 16014c4d1f
commit aa5a27182e
2 changed files with 10 additions and 0 deletions

View file

@ -21,6 +21,11 @@ public class SerializationDocTest {
//#my-own-serializer
public class MyOwnSerializer extends JSerializer {
// If you need logging here, introduce a constructor that takes an ExtendedActorSystem.
// public MyOwnSerializer(ExtendedActorSystem actorSystem)
// Get a logger using:
// private final LoggingAdapter logger = Logging.getLogger(actorSystem, this);
// This is whether "fromBinary" requires a "clazz" or not
@Override public boolean includeManifest() {
return false;

View file

@ -20,6 +20,11 @@ package docs.serialization {
//#my-own-serializer
class MyOwnSerializer extends Serializer {
// If you need logging here, introduce a constructor that takes an ExtendedActorSystem.
// class MyOwnSerializer(actorSystem: ExtendedActorSystem) extends Serializer
// Get a logger using:
// private val logger = Logging(actorSystem, this)
// This is whether "fromBinary" requires a "clazz" or not
def includeManifest: Boolean = true