Skip to content

Commit

Permalink
Sort config and environment dumps.
Browse files Browse the repository at this point in the history
Don't lazily say "Values of 1 sensitive-looking keys hidden".
  • Loading branch information
skington authored and xsawyerx committed Mar 26, 2012
1 parent 4b69024 commit dff7227
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Dancer/Error.pm
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,14 @@ sub dumper {

#use Data::Dumper;
my $dd = Data::Dumper->new([\%data]);
$dd->Terse(1)->Quotekeys(0)->Indent(1);
$dd->Terse(1)->Quotekeys(0)->Indent(1)->Sortkeys(1);
my $content = $dd->Dump();
$content =~ s{(\s*)(\S+)(\s*)=>}{$1<span class="key">$2</span>$3 =&gt;}g;
if ($censored) {
$content
.= "\n\nNote: Values of $censored sensitive-looking keys hidden\n";
.= "\n\nNote: Values of $censored sensitive-looking key"
. ($censored == 1 ? '' : 's')
. " hidden\n";
}
return $content;
}
Expand Down

0 comments on commit dff7227

Please sign in to comment.