perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew O'Brien" <andr...@oriel.com.au>
Subject RE: $escmode in libraries
Date Thu, 17 Mar 2005 23:27:09 GMT

> From: Luiz Fernando B. Ribeiro [mailto:luiz@engenhosolucoes.com.br] 
>
> On Wed, 16 Mar 2005 20:58:37 -0800, Daniel 
> <embperl@7thfire.com> wrote:
> 
> > Is this what you use? I'm a little curious what others do 
> to easily see
> > what variables contain. Maybe there's a good way I'm missing.
> 
> 
> In fact I wrote a module using Data::Dumper that writes 
> variables and  
> traceback information to a debug file. Send debug information 
> to screen  
> may not always be possible and using a debug file allow you 
> to debug a  
> production system without bothering your users.

Yep. Even something as simple as the following is easy to find in the
embperl logfile if you've configured it.

Generally I'm turning on the logfile for debugging live systems anyway -
you get a lot more context  that way and its easy enough to break out
each request based on the pid. The '::' is just a random delimiter -
it's not special in any way.

 sub debug {
   my $self = shift;
   return unless $some_package_or_whatever_global_saying_I_should_debug;
   print HTML::Embperl::LOG "[$$]DBG: ".join('::',@_)."\n";
 }

Cheers,

Andrew

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message