Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

horrible hack to not barf on objects

  • Loading branch information...
commit f9ba78e848315fb8b1dd133f15a1157a26e5fa1e 1 parent 05fd135
Ricardo Signes authored
Showing with 8 additions and 0 deletions.
  1. +2 −0  Changes
  2. +1 −0  dist.ini
  3. +5 −0 lib/String/Flogger.pm
2  Changes
View
@@ -1,6 +1,8 @@
Revision history for String-Flogger
{{$NEXT}}
+ use horrible hack to avoid dying when a data structure to log
+ contains an object
1.101242 2012-03-26 08:20:22 America/New_York
make ->flog({...}) act like ->flog([ '%s', {...} ])
1  dist.ini
View
@@ -5,3 +5,4 @@ copyright_holder = Ricardo SIGNES <rjbs@cpan.org>
[@RJBS]
version = 1
+github_issues = 1
5 lib/String/Flogger.pm
View
@@ -79,6 +79,11 @@ sub _stringify_ref {
->space_after(1)
->convert_blessed(1);
+ # This is horrible. Just horrible. I wish I could do this with a callback
+ # passed to JSON: https://rt.cpan.org/Ticket/Display.html?id=54321
+ # -- rjbs, 2013-01-31
+ local *UNIVERSAL::TO_JSON = sub { "obj($_[0])" };
+
return '{{' . $JSON->encode($ref) . '}}'
}
Please sign in to comment.
Something went wrong with that request. Please try again.