Sha256: 93467a95777c98baa1a3af13ea3c9860abe22685d3bf682dafe6b790736b68bc
Contents?: true
Size: 555 Bytes
Versions: 14
Compression:
Stored size: 555 Bytes
Contents
# frozen_string_literals: true require 'pp' require 'stringio' module Lumberjack class Formatter # Format an object with it's pretty print method. class PrettyPrintFormatter attr_accessor :width # Create a new formatter. The maximum width of the message can be specified with the width # parameter (defaults to 79 characters). def initialize(width = 79) @width = width end def call(obj) s = StringIO.new PP.pp(obj, s) s.string.chomp end end end end
Version data entries
14 entries across 14 versions & 3 rubygems