[Dancer-users] Dancer logging stringifies some data
sawyer x
xsawyerx at gmail.com
Fri Jun 22 16:34:32 CEST 2012
On Fri, Jun 22, 2012 at 5:06 PM, Mr. Puneet Kishor <punk.kish at gmail.com>wrote:
>
> On Jun 21, 2012, at 9:30 PM, Ovid wrote:
>
> > I don't have the time to fix this right now, but we had a very
> interesting issue. I had this line in my code:
> >
> > info "Bidding on auction $id", $bid;
> >
> > That turned out to be a massive bug!
> >
> > $bid is a hashref that gets serialized to JSON. Unfortunately, the act
> of printing out the data flipped one value from an NV (float) to a PV
> (string). That caused the JSON serializer render 1.2 as "1.2".
>
>
> I too would like to see this work correctly. For now, I simply traverse
> the entire data structure and multiply each numeric value by 1 to ensure it
> doesn't get stringified when converted to JSON.
>
That's not very efficient. You can either do what Ovid did (remove the
info() line) or make a local copy of it and sending the local copy to
info().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120622/9a722241/attachment.htm>
More information about the Dancer-users
mailing list