From f40d6f9cad20e50d8eb43b3eb99360926bf20fd7 Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Fri, 18 Oct 2024 14:29:42 -0600 Subject: [PATCH] DEV: Add some more verbose logging for debugging groups (#242) Sometimes users aren't added to groups so adding some more logging statements to aid in debugging. --- .../discourse_subscriptions/hooks_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/controllers/discourse_subscriptions/hooks_controller.rb b/app/controllers/discourse_subscriptions/hooks_controller.rb index 0e6eafe..15a9d7b 100644 --- a/app/controllers/discourse_subscriptions/hooks_controller.rb +++ b/app/controllers/discourse_subscriptions/hooks_controller.rb @@ -68,6 +68,16 @@ module DiscourseSubscriptions group = plan_group(item[:price]) group.add(user) unless group.nil? + + if SiteSetting.discourse_subscriptions_enable_verbose_logging + Rails.logger.warn("Line item with group name meta data: #{item[:price]}") + if group.nil? + Rails.logger.warn("Group not found or not listed in metadata!") + else + Rails.logger.warn("Group: #{group.name}") + end + end + discourse_customer.product_id = item[:price][:product] discourse_customer.save!