lib/lita/adapters/ringcentral/connector.rb in lita-ringcentral-0.0.2 vs lib/lita/adapters/ringcentral/connector.rb in lita-ringcentral-0.0.3
- old
+ new
@@ -13,18 +13,19 @@
@username = username
@extension = extension
@password = password
@token = token
@sms_number = sms_number
+ @logger_prefix = " -- #{self.class.name}: "
end
def connect
client_connect
end
def client_connect
- Lita.logger.info('Authenticating with RingCentral.')
+ Lita.logger.info("#{@logger_prefix}Authenticating with RingCentral.")
if @token.nil?
@client.authorize_password @username, @extension, @password
else
@client.set_token @token
end
@@ -37,10 +38,10 @@
observer = Lita::Adapters::RingCentral::Callback.new @robot
@subscription.add_observer observer
end
def message(to_number, strings)
- Lita.logger.info("Sending message to #{to_number}")
+ Lita.logger.info("#{@logger_prefix}Sending message to #{to_number}")
Lita.logger.info MultiJson.encode(strings)
strings.each do |s|
@client.messages.sms.create(
from: @sms_number,
to: to_number,
\ No newline at end of file