Skip to content

Commit

Permalink
use more specific log levels when logging connect errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Feb 22, 2010
1 parent a5838b6 commit 0680b2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/proxymachine/client_connection.rb
Expand Up @@ -33,7 +33,7 @@ def receive_data(data)
end
rescue => e
close_connection
LOGGER.info "#{e.class} - #{e.message}"
LOGGER.error "#{e.class} - #{e.message}"
end

# Called when new data is available from the client but no remote
Expand Down Expand Up @@ -99,10 +99,10 @@ def server_connection_failed
@server_side = nil
if @tries < 10
@tries += 1
LOGGER.info "Retrying connection with #{@remote.join(':')} (##{@tries})"
LOGGER.warn "Retrying connection with #{@remote.join(':')} (##{@tries})"
EM.add_timer(0.1) { connect_to_server }
else
LOGGER.info "Connect #{@remote.join(':')} failed after ten attempts."
LOGGER.error "Connect #{@remote.join(':')} failed after ten attempts."
close_connection
ProxyMachine.connect_error_callback.call(@remote.join(':'))
end
Expand All @@ -113,7 +113,7 @@ def server_connection_failed
# elapsed argument is the amount of time that actually elapsed since
# connecting but not receiving any data.
def server_inactivity_timeout(timeout, elapsed)
LOGGER.info "Disconnecting #{@remote.join(':')} after #{elapsed}s of inactivity (> #{timeout.inspect})"
LOGGER.error "Disconnecting #{@remote.join(':')} after #{elapsed}s of inactivity (> #{timeout.inspect})"
@server_side = nil
close_connection
ProxyMachine.inactivity_error_callback.call(@remote.join(':'))
Expand Down

0 comments on commit 0680b2f

Please sign in to comment.