{
    "mode": "perldoc",
    "parameter": "Test2::EventFacet::Trace",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test2%3A%3AEventFacet%3A%3ATrace/json",
    "generated": "2026-06-12T03:08:47Z",
    "synopsis": "use Test2::EventFacet::Trace;\nmy $trace = Test2::EventFacet::Trace->new(\nframe => [$package, $file, $line, $subname],\n);",
    "sections": {
        "NAME": {
            "content": "Test2::EventFacet::Trace - Debug information for events\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The Test2::API::Context object, as well as all Test2::Event types need to have access to\ninformation about where they were created. This object represents that information.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Test2::EventFacet::Trace;\n\nmy $trace = Test2::EventFacet::Trace->new(\nframe => [$package, $file, $line, $subname],\n);\n",
            "subsections": []
        },
        "FACET FIELDS": {
            "content": "$string = $trace->{details}\n$string = $trace->details()\nUsed as a custom trace message that will be used INSTEAD of \"at <FILE> line <LINE>\" when\ncalling \"$trace->debug\".\n\n$frame = $trace->{frame}\n$frame = $trace->frame()\nGet the call frame arrayref.\n\n[$package, $file, $line, $subname]\n\n$int = $trace->{pid}\n$int = $trace->pid()\nThe process ID in which the event was generated.\n\n$int = $trace->{tid}\n$int = $trace->tid()\nThe thread ID in which the event was generated.\n\n$id = $trace->{cid}\n$id = $trace->cid()\nThe ID of the context that was used to create the event.\n\n$uuid = $trace->{uuid}\n$uuid = $trace->uuid()\nThe UUID of the context that was used to create the event. (If uuid tagging was enabled)\n\n($pkg, $file, $line, $subname) = $trace->call\nGet the basic call info as a list.\n\n@caller = $trace->fullcall\nGet the full caller(N) results.\n\n$warningbits = $trace->warningbits\nGet index 9 from the full caller info. This is the warningsbits field.\n\nThe value of this is not portable across perl versions or even processes. However it can be\nused in the process that generated it to reproduce the warnings settings in a new scope.\n\neval <<EOT;\nBEGIN { ${^WARNINGBITS} = $trace->warningbits };\n... context's warning settings apply here ...\nEOT\n\nDISCOURAGED HUB RELATED FIELDS\nThese fields were not always set properly by tools. These are MOSTLY deprecated by the\nTest2::EventFacet::Hub facets. These fields are not required, and may only reflect the hub that\nwas current when the event was created, which is not necessarily the same as the hub the event\nwas sent through.\n\nSome tools did do a good job setting these to the correct hub, but you cannot always rely on\nthat. Use the 'hubs' facet list instead.\n\n$hid = $trace->{hid}\n$hid = $trace->hid()\nThe ID of the hub that was current when the event was created.\n\n$huuid = $trace->{huuid}\n$huuid = $trace->huuid()\nThe UUID of the hub that was current when the event was created. (If uuid tagging was\nenabled).\n\n$int = $trace->{nested}\n$int = $trace->nested()\nHow deeply nested the event is.\n\n$bool = $trace->{buffered}\n$bool = $trace->buffered()\nTrue if the event was buffered and not sent to the formatter independent of a parent (This\nshould never be set when nested is 0 or \"undef\").\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Note: All facet frames are also methods.\n\n$trace->setdetail($msg)\n$msg = $trace->detail\nUsed to get/set a custom trace message that will be used INSTEAD of \"at <FILE> line <LINE>\"\nwhen calling \"$trace->debug\".\n\n\"detail()\" is an alias to the \"details\" facet field for backwards compatibility.\n\n$str = $trace->debug\nTypically returns the string \"at <FILE> line <LINE>\". If \"detail\" is set then its value will\nbe returned instead.\n\n$trace->alert($MESSAGE)\nThis issues a warning at the frame (filename and line number where errors should be\nreported).\n\n$trace->throw($MESSAGE)\nThis throws an exception at the frame (filename and line number where errors should be\nreported).\n\n($package, $file, $line, $subname) = $trace->call()\nGet the caller details for the debug-info. This is where errors should be reported.\n\n$pkg = $trace->package\nGet the debug-info package.\n\n$file = $trace->file\nGet the debug-info filename.\n\n$line = $trace->line\nGet the debug-info line number.\n\n$subname = $trace->subname\nGet the debug-info subroutine name.\n\n$sig = trace->signature\nGet a signature string that identifies this trace. This is used to check if multiple events\nare related. The signature includes pid, tid, file, line number, and the cid.\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for Test2 can be found at http://github.com/Test-More/test-more/.\n",
            "subsections": []
        },
        "MAINTAINERS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2020 Chad Granum <exodist@cpan.org>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nSee http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "Test2::EventFacet::Trace - Debug information for events",
    "flags": [],
    "examples": [],
    "see_also": []
}