Investigation
Trace System
Inspect repeated callsites with Trace when you need to understand frequency, frame range, and occurrence history.
- Trace history
- Grouping methods
- Stack capture
- When to use ordinary logs
Trace System
Trace logs are designed for repeated diagnostic histories. A normal log says something happened. A trace helps you inspect how often a specific point was hit and how it behaved over time.
AzCon.Trace("AI tick");
var options = new LogOptions(
alias: AzCon.Alias.Dynamic("Enemy 12"),
category: AzCon.Category.AI);
AzCon.Trace("Decision changed", in options);The common AzCon.Trace(...) call uses a stable call-site key based on file, line, and member name. Open a Trace row to inspect occurrence count, timing span, frame range, and occurrence history.
Grouping Methods
| Method | Grouping |
|---|---|
TraceCallsite(message, ...) | Groups all calls from the same source location. |
TraceContext(message, UnityEngine.Object context, ...) | Groups by source location plus Unity object instance. Requires a valid, non-destroyed context. |
TraceContext(message, int contextInstanceId, ...) | Uses a cached instance ID, which is useful from background threads. |
TraceAlias(message, LogAlias alias, ...) | Groups by source location plus logical alias. |
TraceAlias(message, uint aliasId, ...) | Faster variant using a cached alias Id. |
AzCon.TraceCallsite("Damage calculation ran");
AzCon.TraceContext("Enemy state changed", this, AzCon.Category.AI);
var playerAlias = AzCon.Alias.Dynamic("Player 1");
AzCon.TraceAlias("Input packet received", playerAlias, AzCon.Category.Network);Stack Capture
LogConfig.TraceStackMode controls whether trace logs use a cheap call-site frame or full stack capture.
When to Use Trace
- A method is called too often or not often enough.
- You need to compare repeated updates across frames.
- You want callsite history without creating many different log messages.
- Aliases or contexts help separate repeated calls by object or role.
Use ordinary Debug or Log rows when you only need a single event marker.
