diff --git a/lib/rackstash.rb b/lib/rackstash.rb index ce81394..4717a23 100644 --- a/lib/rackstash.rb +++ b/lib/rackstash.rb @@ -47,10 +47,6 @@ module Rackstash FIELD_TAGS = 'tags'.freeze FIELD_TIMESTAMP = '@timestamp'.freeze FIELD_VERSION = '@version'.freeze - - # @!visibility private - # we want to look "native" with our inspect values, 7 for 32-bit, 14 for 64-bit - DEFAULT_OBJ_ID_STR_WIDTH = 0.size == 4 ? 7 : 14 end require 'rackstash/logger' diff --git a/lib/rackstash/fields/abstract_collection.rb b/lib/rackstash/fields/abstract_collection.rb index bcf7316..0791005 100644 --- a/lib/rackstash/fields/abstract_collection.rb +++ b/lib/rackstash/fields/abstract_collection.rb @@ -38,8 +38,8 @@ module Rackstash # # @return [String] human-redable details about the object. def inspect - id_str = (object_id << 1).to_s(16).rjust(DEFAULT_OBJ_ID_STR_WIDTH, '0') - "#<#{self.class.name}:0x#{id_str} #{self}>" + id_str = Object.instance_method(:to_s).bind(self).call[2..-2] + "#<#{id_str} #{self}>" end # Provide a copy of the wrapped {#raw} data in a format allowing direct diff --git a/lib/rackstash/flows.rb b/lib/rackstash/flows.rb index cb4e6d7..1195011 100644 --- a/lib/rackstash/flows.rb +++ b/lib/rackstash/flows.rb @@ -81,8 +81,8 @@ module Rackstash # @return [String] a string representation of `self` def inspect - id_str = (object_id << 1).to_s(16).rjust(DEFAULT_OBJ_ID_STR_WIDTH, '0') - "#<#{self.class.name}:0x#{id_str} #{self}>" + id_str = Object.instance_method(:to_s).bind(self).call[2..-2] + "#<#{id_str} #{self}>" end # @return [Integer] the number of elements in `self`. May be zero.