Tracing and debugging

Tracers capture interesting events corresponding to important parts of
the Actor-style programming model.

Any time an actor is started, it inherits its tracer from its parent.
Actors without an associated tracer object of their own use the
systemwide tracer object, ActorProcess defaultTracer.

Tracer objects

Tracer objects are called as part of exception handling; message
sending, delivery, and interpretation; RPC requesting, replying, and
failure; link and monitor registration and activation; and at major
points in an actor’s lifecycle. They are also called as part of the
logging facility available in
ActorBehavior instances.

ActorEventTracer: the default tracer

The default tracer object is an instance of ActorEventTracer, which
does nothing with any of the trace events it is sent except for:

logging requests, which are sent to the Transcript, and

exceptions, which are printed to the Transcript and the standard
error stream, and which may optionally trigger the opening of a
debugger.

Enabling the system debugger

The default for ActorEventTracer instances is not to debug
exceptions; they are only logged. Use ActorEventTracer >>
#debugExceptions: to enable debugging:

ActorProcessdefaultTracerdebugExceptions:true.

ActorEventStreamTracer

Instances of ActorEventStreamTracer inherit from ActorEventTracer.

They respond to trace events by logging them to a configurable
collection of streams, often including the Transcript or a
standard-error output stream.

The first is emitted at the moment an actor begins to interpret a
received request.

The second is emitted if a request is redirected elsewhere as the
result of a use of #redirectTo:.

The third and fourth capture rejection (error) and resolution (reply)
of a request, respectively; and the fifth is emitted just before a new
request is enqueued for a recipient.

Interactive debugging utilities

The utility ActorProcess class >> #loggingActorNamed: spawns and
returns an actor (proxy) which simply logs every user-level message it
receives to its tracer. Such an actor can be useful during interactive
debugging and exploration of a system.