Changed info logging to debug logging almost everywhere
This commit is contained in:
parent
614c8c72ba
commit
c14bb5a4f8
11 changed files with 39 additions and 42 deletions
|
|
@ -3,21 +3,21 @@ class DevUtilitiesController < ApplicationController
|
||||||
include ApplicationHelper
|
include ApplicationHelper
|
||||||
def warzombie
|
def warzombie
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
if User.owner.email == "tom@tom.joindiaspora.com" && StatusMessage.where(:message => "There's a bomb in the lasagna!?").first == nil
|
if current_user.email == "tom@tom.joindiaspora.com" && StatusMessage.where(:message => "There's a bomb in the lasagna!?").first == nil
|
||||||
StatusMessage.create(:message => "There's a bomb in the lasagna!?", :person => User.owner)
|
StatusMessage.create(:message => "There's a bomb in the lasagna!?", :person => current_user)
|
||||||
Bookmark.create(:title => "xkcd", :link => "http://xkcd.com/743/", :person => User.owner )
|
Bookmark.create(:title => "xkcd", :link => "http://xkcd.com/743/", :person => current_user )
|
||||||
StatusMessage.create(:message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :person => User.owner, :created_at => Time.now-930)
|
StatusMessage.create(:message => "I switched to Motoroi today, a Motorola Android-based phone, in Korea. Now, I am using Android phones in both the U.S. and Korea", :person => current_user, :created_at => Time.now-930)
|
||||||
StatusMessage.create(:message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :person => User.owner, :created_at => Time.now-43990)
|
StatusMessage.create(:message => "I had 5 hours to study for it :-( GREs on Thursday. Wunderbar.", :person => current_user, :created_at => Time.now-43990)
|
||||||
StatusMessage.create(:message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :person => User.owner, :created_at => Time.now-4390)
|
StatusMessage.create(:message => "Spotted in toy story 3: google maps, OSX, and windows XP. Two out of three isn't bad.", :person => current_user, :created_at => Time.now-4390)
|
||||||
Bookmark.create( :title => "Reddit", :link => "http://reddit.com", :person => User.owner, :created_at => Time.now-54390)
|
Bookmark.create( :title => "Reddit", :link => "http://reddit.com", :person => current_user, :created_at => Time.now-54390)
|
||||||
Blog.create(:title => "I Love Rock'N'Roll - Joan Jett & The Blackhearts", :body => "<p>The loudspeakers played this song as we walked into the city pool for the first time this summer. Those loudspeakers make every song sound fresh even if I have heard it a thousand times and their effect on this song was no different. Joan sounded young and strong and ready, and for a moment I forgot where or when I was.</p> <p>also i can tell it won’t be long and also happy summer imaginary constructs -mumblelard</p>", :person => User.owner, :created_at => Time.now-3090)
|
Blog.create(:title => "I Love Rock'N'Roll - Joan Jett & The Blackhearts", :body => "<p>The loudspeakers played this song as we walked into the city pool for the first time this summer. Those loudspeakers make every song sound fresh even if I have heard it a thousand times and their effect on this song was no different. Joan sounded young and strong and ready, and for a moment I forgot where or when I was.</p> <p>also i can tell it won’t be long and also happy summer imaginary constructs -mumblelard</p>", :person => current_user, :created_at => Time.now-3090)
|
||||||
StatusMessage.create(:message => "Commercials for IE make me SO MAD and my friends just don't get why.", :person => User.owner, :created_at => Time.now-30900)
|
StatusMessage.create(:message => "Commercials for IE make me SO MAD and my friends just don't get why.", :person => current_user, :created_at => Time.now-30900)
|
||||||
Bookmark.create(:title => "Zombo.com", :link => "http://zombo.com", :person => User.owner, :created_at => Time.now-9090)
|
Bookmark.create(:title => "Zombo.com", :link => "http://zombo.com", :person => current_user, :created_at => Time.now-9090)
|
||||||
StatusMessage.create(:message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :person => User.owner, :created_at => Time.now-590000)
|
StatusMessage.create(:message => "Why do I have \"No More Heroes\" by Westlife on repeat all day?", :person => current_user, :created_at => Time.now-590000)
|
||||||
StatusMessage.create(:message => "Mmm. Friday night. Acknowledged.", :person => User.owner, :created_at => Time.now-503900)
|
StatusMessage.create(:message => "Mmm. Friday night. Acknowledged.", :person => current_user, :created_at => Time.now-503900)
|
||||||
StatusMessage.create(:message => "Getting a universal remote is the epitome of laziness, I do declare.", :person => User.owner, :created_at => Time.now-4400)
|
StatusMessage.create(:message => "Getting a universal remote is the epitome of laziness, I do declare.", :person => current_user, :created_at => Time.now-4400)
|
||||||
StatusMessage.create(:message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :person => User.owner, :created_at => Time.now-400239)
|
StatusMessage.create(:message => "Does anyone know how to merge two Skype contact entries of the same person? (i.e. one Skype ID and one mobile number)", :person => current_user, :created_at => Time.now-400239)
|
||||||
StatusMessage.create(:message => "A cool, cool morning for once.", :person => User.owner, :created_at => Time.now-150000)
|
StatusMessage.create(:message => "A cool, cool morning for once.", :person => current_user, :created_at => Time.now-150000)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -25,10 +25,10 @@ def warzombie
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
bkr_info = backer_info
|
bkr_info = backer_info
|
||||||
|
|
||||||
if User.owner.email == "tom@tom.joindiaspora.com" && User.owner.friends.first.nil?
|
if current_user.email == "tom@tom.joindiaspora.com" && current_user.friends.first.nil?
|
||||||
bkr_info.each do |backer|
|
bkr_info.each do |backer|
|
||||||
logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}"
|
logger.debug "Zombefriending #{backer['given_name']} #{backer['family_name']}"
|
||||||
User.owner.send_friend_request_to("http://#{backer['username']}.joindiaspora.com/")
|
current_user.send_friend_request_to("http://#{backer['username']}.joindiaspora.com/")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -36,7 +36,7 @@ def warzombie
|
||||||
def zombiefriendaccept
|
def zombiefriendaccept
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
Request.all.each{|r|
|
Request.all.each{|r|
|
||||||
User.owner.accept_friend_request(r.id)
|
current_user.accept_friend_request(r.id)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class PublicsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def receive
|
def receive
|
||||||
Rails.logger.info "PublicsController has received: #{params[:xml]}"
|
Rails.logger.debug "PublicsController has received: #{params[:xml]}"
|
||||||
store_objects_from_xml params[:xml]
|
store_objects_from_xml params[:xml]
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ class RequestsController < ApplicationController
|
||||||
|
|
||||||
def create
|
def create
|
||||||
rel_hash = relationship_flow(params[:request][:destination_url])
|
rel_hash = relationship_flow(params[:request][:destination_url])
|
||||||
Rails.logger.info("Sending request: #{rel_hash}")
|
Rails.logger.debug("Sending request: #{rel_hash}")
|
||||||
@request = current_user.send_request(rel_hash)
|
@request = current_user.send_request(rel_hash)
|
||||||
|
|
||||||
if @request
|
if @request
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,9 @@ class Photo < Post
|
||||||
end
|
end
|
||||||
|
|
||||||
def remote_photo= remote_path
|
def remote_photo= remote_path
|
||||||
Rails.logger.info("Setting remote photo with id #{id}")
|
|
||||||
@remote_photo = remote_path
|
@remote_photo = remote_path
|
||||||
image.download! remote_path
|
image.download! remote_path
|
||||||
image.store!
|
image.store!
|
||||||
Rails.logger.info("Setting remote photo with id #{id}")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def ensure_user_picture
|
def ensure_user_picture
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ class Post
|
||||||
end
|
end
|
||||||
|
|
||||||
def log_inspection
|
def log_inspection
|
||||||
Rails.logger.info self.inspect
|
Rails.logger.debug self.inspect
|
||||||
end
|
end
|
||||||
def log_save_inspection
|
def log_save_inspection
|
||||||
Rails.logger.info "After saving, object is:"
|
Rails.logger.debug "After saving, object is:"
|
||||||
log_inspection
|
log_inspection
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class Retraction
|
||||||
def perform
|
def perform
|
||||||
begin
|
begin
|
||||||
return unless signature_valid?
|
return unless signature_valid?
|
||||||
Rails.logger.info("Retracting #{self.type} id: #{self.post_id}")
|
Rails.logger.debug("Retracting #{self.type} id: #{self.post_id}")
|
||||||
self.type.constantize.destroy(self.post_id)
|
self.type.constantize.destroy(self.post_id)
|
||||||
rescue NameError
|
rescue NameError
|
||||||
Rails.logger.info("Retraction for unknown type recieved.")
|
Rails.logger.info("Retraction for unknown type recieved.")
|
||||||
|
|
|
||||||
|
|
@ -64,18 +64,18 @@ class User
|
||||||
end
|
end
|
||||||
|
|
||||||
def receive_friend_request(friend_request)
|
def receive_friend_request(friend_request)
|
||||||
Rails.logger.info("receiving friend request #{friend_request.to_json}")
|
Rails.logger.debug("receiving friend request #{friend_request.to_json}")
|
||||||
|
|
||||||
friend_request.person.serialized_key = friend_request.exported_key
|
friend_request.person.serialized_key = friend_request.exported_key
|
||||||
if Request.where(:callback_url => friend_request.callback_url).first
|
if Request.where(:callback_url => friend_request.callback_url).first
|
||||||
activate_friend friend_request.person
|
activate_friend friend_request.person
|
||||||
Rails.logger.info("#{self.real_name}'s friend request has been accepted")
|
Rails.logger.debug("#{self.real_name}'s friend request has been accepted")
|
||||||
friend_request.destroy
|
friend_request.destroy
|
||||||
else
|
else
|
||||||
friend_request.person.save
|
friend_request.person.save
|
||||||
pending_friends << friend_request.person
|
pending_friends << friend_request.person
|
||||||
save
|
save
|
||||||
Rails.logger.info("#{self.real_name} has received a friend request")
|
Rails.logger.debug("#{self.real_name} has received a friend request")
|
||||||
friend_request.save
|
friend_request.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,12 @@ module WebSocket
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.push_to_user(uid, data)
|
def self.push_to_user(uid, data)
|
||||||
puts @channels.size
|
Rails.logger.debug "Websocketing to #{uid}"
|
||||||
Rails.logger.info "Pushing to #{uid}"
|
|
||||||
@channels[uid.to_s][0].push(data) if @channels[uid.to_s]
|
@channels[uid.to_s][0].push(data) if @channels[uid.to_s]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.subscribe(uid, ws)
|
def self.subscribe(uid, ws)
|
||||||
puts "Subscribing socket to #{User.first(:id => uid).email}"
|
Rails.logger.debug "Subscribing socket to #{User.first(:id => uid).email}"
|
||||||
self.ensure_channel(uid)
|
self.ensure_channel(uid)
|
||||||
@channels[uid][0].subscribe{ |msg| ws.send msg }
|
@channels[uid][0].subscribe{ |msg| ws.send msg }
|
||||||
@channels[uid][1] += 1
|
@channels[uid][1] += 1
|
||||||
|
|
@ -42,11 +41,11 @@ module WebSocket
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.unsubscribe(uid,sid)
|
def self.unsubscribe(uid,sid)
|
||||||
puts "Unsubscribing socket #{sid} from #{User.first(:id => uid).email}"
|
Rails.logger.debug "Unsubscribing socket #{sid} from #{User.first(:id => uid).email}"
|
||||||
@channels[uid][0].unsubscribe(sid) if @channels[uid]
|
@channels[uid][0].unsubscribe(sid) if @channels[uid]
|
||||||
@channels[uid][1] -= 1
|
@channels[uid][1] -= 1
|
||||||
if @channels[uid][1] <= 0
|
if @channels[uid][1] <= 0
|
||||||
@channels[uid] = nil
|
@channels.delete(uid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,16 +45,16 @@ module Diaspora
|
||||||
def store_objects_from_xml(xml)
|
def store_objects_from_xml(xml)
|
||||||
objects = parse_objects_from_xml(xml)
|
objects = parse_objects_from_xml(xml)
|
||||||
objects.each do |p|
|
objects.each do |p|
|
||||||
Rails.logger.info("Receiving object:\n#{p.inspect}")
|
Rails.logger.debug("Receiving object:\n#{p.inspect}")
|
||||||
if p.is_a? Retraction
|
if p.is_a? Retraction
|
||||||
Rails.logger.info "Got a retraction for #{p.post_id}"
|
Rails.logger.debug "Got a retraction for #{p.post_id}"
|
||||||
p.perform
|
p.perform
|
||||||
elsif p.is_a? Request
|
elsif p.is_a? Request
|
||||||
User.owner.receive_friend_request(p)
|
User.owner.receive_friend_request(p)
|
||||||
elsif p.is_a? Profile
|
elsif p.is_a? Profile
|
||||||
p.save
|
p.save
|
||||||
elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User)
|
elsif p.respond_to?(:person) && !(p.person.nil?) && !(p.person.is_a? User)
|
||||||
Rails.logger.info("Saving object with success: #{p.save}")
|
Rails.logger.debug("Saving object with success: #{p.save}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ module Diaspora
|
||||||
unless recipients.empty?
|
unless recipients.empty?
|
||||||
recipients.map!{|x| x = x.url + "receive/"}
|
recipients.map!{|x| x = x.url + "receive/"}
|
||||||
xml = Post.build_xml_for(self)
|
xml = Post.build_xml_for(self)
|
||||||
Rails.logger.info("Adding xml for #{self} to message queue to #{recipients}")
|
Rails.logger.debug("Adding xml for #{self} to message queue to #{recipients}")
|
||||||
@@queue.add_post_request( recipients, xml )
|
@@queue.add_post_request( recipients, xml )
|
||||||
end
|
end
|
||||||
@@queue.process
|
@@queue.process
|
||||||
|
|
@ -29,7 +29,7 @@ module Diaspora
|
||||||
def push_to_url(url)
|
def push_to_url(url)
|
||||||
hook_url = url + "receive/"
|
hook_url = url + "receive/"
|
||||||
xml = self.class.build_xml_for(self)
|
xml = self.class.build_xml_for(self)
|
||||||
Rails.logger.info("Adding xml for #{self} to message queue to #{url}")
|
Rails.logger.debug("Adding xml for #{self} to message queue to #{url}")
|
||||||
@@queue.add_post_request( hook_url, xml )
|
@@queue.add_post_request( hook_url, xml )
|
||||||
@@queue.process
|
@@queue.process
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} did not sign")
|
Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} did not sign")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
Rails.logger.info("Verifying sig on #{signable_string} from person #{person.real_name}")
|
Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.real_name}")
|
||||||
validity = person.encryption_key.verify "SHA", Base64.decode64(signature), signable_string
|
validity = person.encryption_key.verify "SHA", Base64.decode64(signature), signable_string
|
||||||
Rails.logger.info("Validity: #{validity}")
|
Rails.logger.debug("Validity: #{validity}")
|
||||||
validity
|
validity
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_with_key(key)
|
def sign_with_key(key)
|
||||||
Rails.logger.info("Signing #{signable_string}")
|
Rails.logger.debug("Signing #{signable_string}")
|
||||||
Base64.encode64(key.sign "SHA", signable_string)
|
Base64.encode64(key.sign "SHA", signable_string)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue