[Dancer-users] Dancer logging stringifies some data
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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dancer-users