From 7d4aac3b408d3b9c1c14545353027e8126dfd195 Mon Sep 17 00:00:00 2001 From: Wendel Fabian Chinsamy Date: Mon, 13 Jan 2025 17:46:23 +0200 Subject: [PATCH] add logging for debugging --- app/models/concerns/importable.rb | 3 --- app/models/related_identifier.rb | 4 +++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/importable.rb b/app/models/concerns/importable.rb index b741393..994eaba 100644 --- a/app/models/concerns/importable.rb +++ b/app/models/concerns/importable.rb @@ -223,9 +223,6 @@ def parse_record(sqs_msg: nil, data: nil) ["DOI", "URL"].include?(r["relatedIdentifierType"]) end - Rails.logger.info("importable the response is: #{response.inspect}") - Rails.logger.info(related_identifiers.inspect) - if related_identifiers.any? { |r| r["relatedIdentifierType"] == "DOI" } item = { "id" => data["id"], diff --git a/app/models/related_identifier.rb b/app/models/related_identifier.rb index dc1bf73..219f3ba 100644 --- a/app/models/related_identifier.rb +++ b/app/models/related_identifier.rb @@ -58,9 +58,11 @@ def push_data(result, _options = {}) end def self.push_item(item) - Rails.logger.info("Related Identifier: push_item") + Rails.logger.info("Related Identifier: push_item start") attributes = item.fetch("attributes", {}) + Rails.logger.info("Related Identifier: attributes -> #{attributes.inspect}") doi = attributes.fetch("doi", nil) + Rails.logger.info("Related Identifier: doi -> #{doi.inspect}") if doi.blank? Rails.logger.info("[Related Identifier: doi is blank]")