- Index
- »
- fan.hxConn
- »
- ConnTrace
ConnTrace
const class ConnTrace : Actor
ConnTrace provides a debug trace for each connector. Trace messages are stored in RAM using a circular buffer.
Trace a phase message
Trace a protocol specific response message
Trace a dispatch message
Get the current trace messages or empty list if not enabled
Max number of trace messages to store in RAM
Clear the trace log
Trace a poll message
Read all trace messages since the given timestamp
Disable tracing for the connector
Enable tracing the connector
Is tracing currently enabled for the connector
Trace a protocol specific unsolicited event message
Write a trace message
Expose the trace as a standard system log
Trace a protocol specific request message
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 ...
Void clear()
Clear the trace log
Void disable()
Disable tracing for the connector
Void dispatch(HxMsg msg)
Trace a dispatch message
Void enable()
Enable tracing the connector
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.
Bool isEnabled()
Is tracing currently enabled for the connector
Int max()
Max number of trace messages to store in RAM
Void phase(Str msg, Obj? arg)
Trace a phase message
Void poll(Str msg, Obj? arg)
Trace a poll message
ConnTraceMsg[] read()
Get the current trace messages or empty list if not enabled. Messages are ordered from oldest to newest.
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.
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.
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.
Void write(Str type, Str msg, Obj? arg)
Write a trace message