type

ConnTrace

const class ConnTrace : Actor

ConnTrace provides a debug trace for each connector. Trace messages are stored in RAM using a circular buffer.

methods

asLog

Expose the trace as a standard system log.

clear

Clear the trace log

disable

Disable tracing for the connector

dispatch

Trace a dispatch message

enable

Enable tracing the connector

event

Trace a protocol specific unsolicited event message.

isEnabled

Is tracing currently enabled for the connector

max

Max number of trace messages to store in RAM

phase

Trace a phase message

poll

Trace a poll message

read

Get the current trace messages or empty list if not enabled.

readSince

Read all trace messages since the given timestamp.

req

Trace a protocol specific request message.

res

Trace a protocol specific response message.

write

Write a trace message

Slot Details

asLog

Log asLog()

Expose the trace as a standard system log. Messages sent to the log instance are traced as follows:

  • if message starts with ">" it is logged as "req" type
  • if message starts with "<" it is logged as "res" type
  • if message starts with "^" it is logged as "event" type
  • otherwise it is logged as "log" type

When logging as a request/response the 2nd line is used as summary with the expectation that log format is patterned as follows:

< message-id
Summary line
... more details ...

clear

Void clear()

Clear the trace log

disable

Void disable()

Disable tracing for the connector

dispatch

Void dispatch(HxMsg msg)

Trace a dispatch message

enable

Void enable()

Enable tracing the connector

event

Void event(Str msg, Obj arg)

Trace a protocol specific unsolicited event message. The arg must be a Str or Buf. If arg is a Buf then you must call toImmutable on it first to ensure backing array is not cleared.

isEnabled

Bool isEnabled()

Is tracing currently enabled for the connector

max

Int max()

Max number of trace messages to store in RAM

phase

Void phase(Str msg, Obj? arg := null)

Trace a phase message

poll

Void poll(Str msg, Obj? arg := null)

Trace a poll message

read

ConnTraceMsg[] read()

Get the current trace messages or empty list if not enabled. Messages are ordered from oldest to newest.

readSince

ConnTraceMsg[] readSince(DateTime? since)

Read all trace messages since the given timestamp. If the timestamp is null, then read all messages in the buffer. Messages are ordered from oldest to newest.

req

Void req(Str msg, Obj arg)

Trace a protocol specific request message. The arg must be a Str or Buf. If arg is a Buf then you must call toImmutable on it first to ensure backing array is not cleared.

res

Void res(Str msg, Obj arg)

Trace a protocol specific response message. The arg must be a Str or Buf. If arg is a Buf then you must call toImmutable on it first to ensure backing array is not cleared.

write

Void write(Str type, Str msg, Obj? arg := null)

Write a trace message