A suggestion: CGI::App already has built-in diagnostics functions (the dump() runmode). Would it make sense for your plugin to include this output automatically (at a very low level)? Maybe a new option ( CGIAPP_DUMP => 'info' ) ?You could probably do that yourself already
Yeah, but I am lazy. :-)
by setting up a dispatcher that used a custom callback which appended the dump info. The trick would be to get the $self object into the callback.
I dont think that is necessary.The plugin would just get the messages (as a string) from $self->dump and
hand it off to the log dispatcher(s).
Could you elaborate a little bit more on how you would actually want it work, and what it would do?
Well, you set up your logger like so:
$self->log_config( CGIAPP_DUMP => 'debug' );
And the plugin would get the $self->dump() and log it with "debug". Can happen in log_config, right after installing the loggers. Another idea:Is it possible to install a SIGWARN handler that dispatched to this plugin ?
This has two advantages:a) you can write "warn" instead of $self->log->warning (small advantage) b) it works for all the external modules already wrote "warn", know nothing about CGI::App or Log::Dispatch and that you cannot change (bigger advantage)
Okay, I know it is possible, what I am doing now is
$main::SIG{__WARN__} = sub { .... } # some appropriate closure
in cgiapp_init, but is this a good idea?
It probably has problems under mod_perl (although I am removing the
handler in cgiapp_teardown).
If it is a good idea, another option INSTALL_SIGWARN_HANDLER would be
nice.
Thilo
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.