Hi,<br><br>I have a Catalyst app, running 5.7011, and I keep the debugging log turned on as the parameters and sequence of events is far more useful than the disk space and request overhead, at least currently.<br><br>Recently, I&#39;ve had to start accepting credit cards. I&#39;m required to not log them, but I&#39;d also like to keep the debug log going. So, I&#39;ve copied Catalyst.pm&#39;s prepare_body() method into MyApp.pm, and added the following line to the block which prepares the Text::SimpleTable output for the log:<br>
<br>        my $t = Text::SimpleTable-&gt;new( [ 35, &#39;Parameter&#39; ], [ 36, &#39;Value&#39; ] );<br>        for my $key ( sort keys %{ $c-&gt;req-&gt;body_parameters } ) {<br>            my $param = $c-&gt;req-&gt;body_parameters-&gt;{$key};<br>
            my $value = defined($param) ? $param : &#39;&#39;;<br>+          $value = (grep { $key eq $_ } qw(cardnumber password)) ? &#39;&lt;masked&gt;&#39; : $value;<br>            $t-&gt;row( $key,<br>                ref $value eq &#39;ARRAY&#39; ? ( join &#39;, &#39;, @$value ) : $value );<br>
        }<br><br>As you can see, I&#39;ve taken the opportunity to mask the password from the log too.<br><br>My question is: is there a better, or more Catalyst-approved way of accomplishing this? This seemed to be the most direct/simple way, but it would have been nice if the Text::SimpleTable stuff was in a method of its own.<br>
<br>Thanks,<br><br>-- <br>Ewan Edwards, <a href="mailto:eskwayrd@gmail.com">eskwayrd@gmail.com</a><br>