lib/alephant/lookup/lookup_table.rb in alephant-lookup-0.4.2 vs lib/alephant/lookup/lookup_table.rb in alephant-lookup-1.0.0

- old
+ new

@@ -13,16 +13,18 @@ def initialize(table_name) @mutex = Mutex.new @client = AWS::DynamoDB::Client::V20120810.new @table_name = table_name - logger.info "LookupTable#initialize: table name '#{table_name}'" + logger.info( + "event" => "LookupTableInitialized", + "tableName" => table_name, + "method" => "#{self.class}#initialize" + ) end def write(component_key, version, location) - logger.info "LookupTable#write: component key '#{component_key}', version '#{version}', location '#{location}'" - client.put_item({ :table_name => table_name, :item => { 'component_key' => { 'S' => component_key.to_s @@ -32,10 +34,18 @@ }, 'location' => { 'S' => location.to_s } } - }) + }).tap do + logger.info( + "event" => "LookupLocationWritten", + "componentKey" => component_key, + "version" => version, + "location" => location, + "method" => "#{self.class}#write" + ) + end end end end end