Class: Lumberjack::Formatter::InspectFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/lumberjack/formatter/inspect_formatter.rb

Overview

Format an object by calling inspect on it. This formatter provides a debugging-friendly representation of objects, showing their internal structure and contents in a readable format.

The InspectFormatter is particularly useful for logging complex objects where you need to see their complete state, such as arrays, hashes, or custom objects. It relies on Ruby’s built-in inspect method, which provides detailed object representations.

Instance Method Summary collapse

Instance Method Details

#call(obj) ⇒ String

Convert an object to its inspect representation.

Parameters:

  • obj (Object)

    The object to format.

Returns:

  • (String)

    The inspect representation of the object.



20
21
22
# File 'lib/lumberjack/formatter/inspect_formatter.rb', line 20

def call(obj)
  obj.inspect
end