View Source Grizzly.Trace (grizzly v6.7.0)
Module that tracks the commands that are sent and received by Grizzly
The trace will hold in memory the last 300 messages. If you want to generate
a log file of the trace records you use Grizzly.Trace.dump/1
.
The log format is:
timestamp source destination sequence_number command_name command_parameters
If you want to list the records that are currently being held in memory you
can use Grizzly.Trace.list/0
.
If you want to start traces from a fresh start you can call
Grizzly.Trace.clear/0
.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Force clear the records from the trace
Dump the trace records into a file. See format/2
for the available formats.
Serializes a list of trace records into a binary. The format can be one of
List all the records currently being traced
Log the trace information
Start the trace server
Link to this section Types
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec clear() :: :ok
Force clear the records from the trace
Dump the trace records into a file. See format/2
for the available formats.
@spec format([Grizzly.Trace.Record.t()], format()) :: binary()
Serializes a list of trace records into a binary. The format can be one of:
:text
- Each record is on a new line and is formatted astimestamp source destination sequence_number command_name command_parameters
. This is the default format.:term
- The trace is serialized as a list ofRecord.t()
structs in Erlang external term format. This is useful if you want to load the trace on another machine.
@spec list() :: [Grizzly.Trace.Record.t()]
List all the records currently being traced
Log the trace information
@spec start_link(keyword()) :: GenServer.on_start()
Start the trace server