Cataly...kTrace(3pm)

πŸ“¦
version 0.12 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Catalyst::Plugin::StackTrace πŸ’–

okay bestie, so this is a page from User Contributed Perl Documentation, and it's all about Catalyst::Plugin::StackTrace β€” the plugin that shows you a stack trace right on your debug screen. icon behavior. let's get into it 🫢


✨ NAME ✨

Catalyst::Plugin::StackTrace β€” it displays a stack trace on the debug screen. that's it, that's the job, and it does it gorgeously πŸ’…


🌸 SYNOPSIS 🌸

use Catalyst qw/-Debug StackTrace/;

like, that's the whole thing. one line. we love a low-effort slay ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this plugin glows up the standard Catalyst debug screen by adding a stack trace of your app, all the way up to the exact point where the error happened. every single stack frame gets shown, and each one comes with the package name, the line number, the file name, and the code context surrounding that line number. full picture, no crumbs πŸŽ€

by default this plugin is only active in -Debug mode. but if you want it on anyway, you can flip it on with the enable config option. your app, your rules, no cap.


πŸ‘‘ CONFIGURATION πŸ‘‘

config is optional, btw. and when you do set it, you put it in MyApp->config->{stacktrace}. cute little nested hash, as a treat.

πŸ’œ enable

this one lets you forcibly enable or disable the plugin, straight-up ignoring whatever the current debug setting says. if this option is defined, its value is what gets used. periodt.

πŸ“ context

the number of context lines of code to show on either side of the stack frame line. defaults to 3. so you get the lil before-and-after, like a good story needs setup and payoff.

🌈 reverse

by default, the stack frames show up from "top" to "bottom" (that's newest to oldest). turning this option on reverses them, so you get "bottom" to "top" instead β€” aka from the caller's perspective. main character POV change πŸ’«

⭐ verbose

this one sets how many stack frames you want to see in the stack trace. it defaults to 0, which means only frames from your application's namespace get shown. levels 1 and 2 exist for deeper debugging, iykyk.

if you set it to 1, the stack trace will include frames from packages outside your application's namespace β€” but not from most of the Catalyst internals. the packages ignored at this level are:

Catalyst
Catalyst::Action
Catalyst::Base
Catalyst::Dispatcher
Catalyst::Engine::*
Catalyst::Plugin::StackTrace
Catalyst::Plugin::Static::Simple
NEXT
main

if you set it to 2, the stack trace will include frames from everything except this module. full chaos, full transparency, we stan 😌


🧚 INTERNAL METHODS 🧚

these are the methods this plugin extends. not your everyday hangout spot, but here's the tea:

  • execute β€” in execute, we create a local die handler to generate the stack trace. lowkey the whole engine room of the operation πŸ”₯
  • finalize_error β€” in finalize_error, we inject the stack trace HTML into the debug screen, right below the error message. so you never have to scroll-hunt for it πŸ’…
  • setup β€” extended by this plugin too. (the original really said "no further comment" on this one and honestly? respect.)

πŸ” SEE ALSO πŸ”

  • Catalyst

🫢 AUTHORS 🫢

  • Andy Grundman, <andy@hybridized.org>
  • Matt S. Trout, <mst@shadowcatsystems.co.uk>

πŸ’– THANKS πŸ’–

shoutout to the authors of CGI::Application::Plugin::DebugScreen β€” a LOT of code was used from them. giving credit where credit is due, always πŸŽ€


Copyright (c) 2005 - 2009 the Catalyst::Plugin::StackTrace "AUTHORS" as listed above. so like, the people up there. them. πŸ‘‘


✨ LICENSE ✨

this program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. go forth and remix, bestie πŸ’œ


fr fr, that's the whole page. every option, every default, every method. no details were harmed in the making of this glow-up 🌈

kisses, and may your stack traces always be readable πŸ’‹

this was Cataly...kTrace(3pm) from perl v5.36.0, dated 2022-10-14, straight out of User Contributed Perl Documentation. mwah, bye πŸ¦‹πŸ’–

πŸ“¦ where this page comes from