add XMLLogger to debug federation
This commit is contained in:
parent
97153ad08b
commit
c75f92d07a
2 changed files with 5 additions and 2 deletions
|
|
@ -23,9 +23,11 @@ module Diaspora
|
|||
|
||||
module InstanceMethods
|
||||
def to_diaspora_xml
|
||||
xml = to_xml
|
||||
::Logging::Logger["XMLLogger"].debug "to_xml: #{xml}"
|
||||
<<-XML
|
||||
<XML>
|
||||
<post>#{to_xml.to_s}</post>
|
||||
<post>#{xml}</post>
|
||||
</XML>
|
||||
XML
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ module Diaspora
|
|||
doc = Nokogiri::XML(xml) {|cfg| cfg.noblanks }
|
||||
return unless body = doc.xpath("/XML/post").children.first
|
||||
class_name = body.name.gsub("-", "/")
|
||||
::Logging::Logger["XMLLogger"].debug "from_xml: #{body}"
|
||||
begin
|
||||
class_name.camelize.constantize.from_xml body.to_s
|
||||
rescue NameError => e
|
||||
|
|
|
|||
Loading…
Reference in a new issue