Module: Blather

Defined in:
lib/blather.rb,
lib/blather/jid.rb,
lib/blather/errors.rb,
lib/blather/roster.rb,
lib/blather/stanza.rb,
lib/blather/stream.rb,
lib/blather/version.rb,
lib/blather/stanza/x.rb,
lib/blather/stanza/iq.rb,
lib/blather/xmpp_node.rb,
lib/blather/cert_store.rb,
lib/blather/client/dsl.rb,
lib/blather/roster_item.rb,
lib/blather/stanza/disco.rb,
lib/blather/stanza/iq/si.rb,
lib/blather/client/client.rb,
lib/blather/file_transfer.rb,
lib/blather/stanza/iq/ibb.rb,
lib/blather/stanza/iq/s5b.rb,
lib/blather/stanza/pubsub.rb,
lib/blather/stream/client.rb,
lib/blather/stream/parser.rb,
lib/blather/stanza/iq/ping.rb,
lib/blather/stanza/message.rb,
lib/blather/stanza/iq/query.rb,
lib/blather/stanza/iq/vcard.rb,
lib/blather/stanza/presence.rb,
lib/blather/stream/features.rb,
lib/blather/stanza/iq/roster.rb,
lib/blather/stream/component.rb,
lib/blather/client/dsl/pubsub.rb,
lib/blather/errors/sasl_error.rb,
lib/blather/file_transfer/ibb.rb,
lib/blather/file_transfer/s5b.rb,
lib/blather/stanza/iq/command.rb,
lib/blather/stanza/presence/c.rb,
lib/blather/errors/stanza_error.rb,
lib/blather/errors/stream_error.rb,
lib/blather/stanza/presence/muc.rb,
lib/blather/stanza/pubsub/event.rb,
lib/blather/stanza/pubsub/items.rb,
lib/blather/stanza/pubsub_owner.rb,
lib/blather/stream/features/tls.rb,
lib/blather/stanza/pubsub/create.rb,
lib/blather/stanza/pubsub/errors.rb,
lib/blather/stream/features/sasl.rb,
lib/blather/stanza/pubsub/publish.rb,
lib/blather/stanza/pubsub/retract.rb,
lib/blather/stanza/presence/status.rb,
lib/blather/stanza/disco/disco_info.rb,
lib/blather/stanza/message/muc_user.rb,
lib/blather/stanza/pubsub/subscribe.rb,
lib/blather/stream/features/session.rb,
lib/blather/stanza/disco/disco_items.rb,
lib/blather/stanza/muc/muc_user_base.rb,
lib/blather/stanza/presence/muc_user.rb,
lib/blather/stream/features/register.rb,
lib/blather/stream/features/resource.rb,
lib/blather/stanza/disco/capabilities.rb,
lib/blather/stanza/pubsub/unsubscribe.rb,
lib/blather/stanza/pubsub_owner/purge.rb,
lib/blather/stanza/pubsub/affiliations.rb,
lib/blather/stanza/pubsub/subscription.rb,
lib/blather/stanza/pubsub_owner/delete.rb,
lib/blather/stanza/pubsub/subscriptions.rb,
lib/blather/stanza/presence/subscription.rb

Defined Under Namespace

Modules: DSL Classes: ArgumentError, BlatherError, CertStore, Client, FileTransfer, JID, ParseError, Roster, RosterItem, SASLError, Stanza, StanzaError, Stream, StreamError, UnknownResponse, XMPPNode

Constant Summary collapse

VERSION =
'2.0.0'
@@logger =
nil

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.default_log_levelObject

Default logger level. Any internal call to log() will forward the log message to the default log level



92
93
94
# File 'lib/blather.rb', line 92

def default_log_level
  @default_log_level
end

Class Method Details

.log(message) ⇒ Object



106
107
108
# File 'lib/blather.rb', line 106

def log(message)
  logger.send self.default_log_level, message
end

.loggerObject



94
95
96
# File 'lib/blather.rb', line 94

def logger
  @@logger ||= Logger.new($stdout).tap {|logger| logger.level = Logger::INFO }
end

.logger=(logger) ⇒ Object



98
99
100
# File 'lib/blather.rb', line 98

def logger=(logger)
  @@logger = logger
end