# perldoc > Test2::EventFacet::Trace

---
type: CommandReference
command: Test2::EventFacet::Trace
mode: perldoc
section: 
source: perldoc
---

## Quick Reference
- `$trace = Test2::EventFacet::Trace->new(frame => [$pkg, $file, $line, $sub])` — create a trace object
- `$trace->debug` — returns "at <file> line <line>" or custom detail
- `$trace->alert($msg)` — warn at the trace frame
- `$trace->throw($msg)` — die at the trace frame
- `($pkg, $file, $line, $sub) = $trace->call` — get caller info
- `$trace->file`, `$trace->line` — get file/line
- `$trace->signature` — unique signature (pid, tid, file, line, cid)
- `$trace->detail("custom message")` — set custom debug message

## Name
Test2::EventFacet::Trace — Debug information for events

## Synopsis
perl
use Test2::EventFacet::Trace;
my $trace = Test2::EventFacet::Trace->new(
    frame => [$package, $file, $line, $subname],
);
## Options
### Facet Fields (also accessible as methods)
- `$trace->{details}`, `$trace->details()` — custom trace message, used instead of "at <FILE> line <LINE>" in `debug`
- `$trace->{frame}`, `$trace->frame()` — call frame arrayref `[$package, $file, $line, $subname]`
- `$trace->{pid}`, `$trace->pid()` — process ID of event creation
- `$trace->{tid}`, `$trace->tid()` — thread ID of event creation
- `$trace->{cid}`, `$trace->cid()` — context ID used to create event
- `$trace->{uuid}`, `$trace->uuid()` — context UUID (if uuid tagging enabled)
- `($pkg, $file, $line, $subname) = $trace->call` — caller info as list
- `@caller = $trace->full_call` — full `caller(N)` results
- `$trace->warning_bits` — index 9 of full caller, used to reproduce warning settings:
    ```perl
    eval <<EOT;
    BEGIN { ${^WARNING_BITS} = $trace->warning_bits };
    ... context's warning settings apply here ...
    EOT
    
### Discouraged Hub Related Fields
- `$trace->{hid}`, `$trace->hid()` — hub ID current when event created (may not reflect actual hub)
- `$trace->{huuid}`, `$trace->huuid()` — hub UUID (if uuid tagging enabled)
- `$trace->{nested}`, `$trace->nested()` — nesting depth of event
- `$trace->{buffered}`, `$trace->buffered()` — true if event was buffered (should not be set when nested is 0 or undef)

### Methods
- `$trace->set_detail($msg)`, `$msg = $trace->detail` — get/set custom trace message (alias for `details` field)
- `$str = $trace->debug` — returns "at <FILE> line <LINE>" or custom `detail` if set
- `$trace->alert($MESSAGE)` — issues warning at the trace frame (file:line)
- `$trace->throw($MESSAGE)` — throws exception at the trace frame
- `($package, $file, $line, $subname) = $trace->call()` — get caller details for error reporting
- `$pkg = $trace->package` — debug-info package
- `$file = $trace->file` — debug-info filename
- `$line = $trace->line` — debug-info line number
- `$subname = $trace->subname` — debug-info subroutine name
- `$sig = $trace->signature` — unique signature string (includes pid, tid, file, line, cid); used to check if multiple events are related

## See Also
- [Test2::API::Context](http://localhost/phpMan.php/perldoc/Test2%3A%3AAPI%3A%3AContext/markdown)
- [Test2::Event](http://localhost/phpMan.php/perldoc/Test2%3A%3AEvent/markdown)
- [Test2::EventFacet::Hub](http://localhost/phpMan.php/perldoc/Test2%3A%3AEventFacet%3A%3AHub/markdown)
- Source repository: [http://github.com/Test-More/test-more/](http://github.com/Test-More/test-more/)