| License: | Ruby‘s license (see the LICENSE file) or GNU GPL, at your option. |
Website::http://home.gna.org/xmpp4r/
| XMPP4R_VERSION | = | '0.5' | XMPP4R Version number. This is the ONLY place where the version number should be specified. This constant is used to determine the version of package tarballs and generated gems. |
returns true if debugging mode is enabled. If you just want to log something if debugging is enabled, use Jabber::debuglog instead.
# File lib/xmpp4r/debuglog.rb, line 45
45: def Jabber::debug
46: @@debug
47: end
Enable/disable debugging mode. When debug mode is enabled, information can be logged using Jabber::debuglog. When debug mode is disabled, calls to Jabber::debuglog are just ignored.
# File lib/xmpp4r/debuglog.rb, line 26
26: def Jabber::debug=(debug)
27: @@debug = debug
28: if @@debug
29: debuglog('Debugging mode enabled.')
30: #if debug is enabled, we should automatically enable warnings too
31: Jabber::warnings = true
32: end
33: end
Outputs a string only if debugging mode is enabled. If the string includes several lines, 4 spaces are added at the beginning of each line but the first one. Time is prepended to the string.
# File lib/xmpp4r/debuglog.rb, line 52
52: def Jabber::debuglog(string)
53: return if not @@debug
54: logger.debug string.chomp.gsub("\n", "\n ")
55: end
# File lib/xmpp4r/debuglog.rb, line 8
8: def Jabber::logger
9: @@logger ||= Logger.new($stderr)
10: end
Enable/disable warnings mode.
# File lib/xmpp4r/debuglog.rb, line 36
36: def Jabber::warnings=(warnings)
37: @@warnings = warnings
38: if @@warnings
39: warnlog('Warnings mode enabled.')
40: end
41: end