class Lumberjack::Formatter::PrettyPrintFormatter
Format an object with it’s pretty print method.
Attributes
Public Class Methods
Source
# File lib/lumberjack/formatter/pretty_print_formatter.rb, line 14 def initialize(width = 79) @width = width end
Create a new formatter. The maximum width of the message can be specified with the width parameter (defaults to 79 characters).
Public Instance Methods
Source
# File lib/lumberjack/formatter/pretty_print_formatter.rb, line 18 def call(obj) s = StringIO.new PP.pp(obj, s) s.string.chomp end