add XMLLogger to debug federation

This commit is contained in:
Benjamin Neff 2015-06-07 00:50:02 +02:00 committed by Dennis Schubert
parent 97153ad08b
commit c75f92d07a
2 changed files with 5 additions and 2 deletions

View file

@ -23,11 +23,13 @@ module Diaspora
module InstanceMethods module InstanceMethods
def to_diaspora_xml def to_diaspora_xml
xml = to_xml
::Logging::Logger["XMLLogger"].debug "to_xml: #{xml}"
<<-XML <<-XML
<XML> <XML>
<post>#{to_xml.to_s}</post> <post>#{xml}</post>
</XML> </XML>
XML XML
end end
def x(input) def x(input)

View file

@ -8,6 +8,7 @@ module Diaspora
doc = Nokogiri::XML(xml) {|cfg| cfg.noblanks } doc = Nokogiri::XML(xml) {|cfg| cfg.noblanks }
return unless body = doc.xpath("/XML/post").children.first return unless body = doc.xpath("/XML/post").children.first
class_name = body.name.gsub("-", "/") class_name = body.name.gsub("-", "/")
::Logging::Logger["XMLLogger"].debug "from_xml: #{body}"
begin begin
class_name.camelize.constantize.from_xml body.to_s class_name.camelize.constantize.from_xml body.to_s
rescue NameError => e rescue NameError => e