Xirsys.XTurn.PacketLog.Writer (xturn v2.0.0)

Copy Markdown View Source

Serialises packet log lines to a dedicated file.

What problem this solves

PacketLog runs on the STUN/TURN hot path and must not block on disk I/O. This GenServer accepts append casts and writes lines to :packet_log_path (default log/packets.log). Write failures are swallowed so logging never crashes relay traffic.

Internal: started from the application supervision tree.

RFCs

No STUN/TURN RFC applies. Operational tracing of datagrams that carry RFC 8489 / RFC 5766 traffic.

Summary

Functions

Asynchronously appends one log line (without a trailing newline).

Returns a specification to start this module under a supervisor.

Starts the writer (registered as __MODULE__).

Functions

append(line)

@spec append(String.t()) :: :ok

Asynchronously appends one log line (without a trailing newline).

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

Starts the writer (registered as __MODULE__).